<< 11-05-2020 >>

00:17:18dadadahmm, how do I get a type's string representation at runtime? foo.type.repr doesn't work here
00:18:24FromGitter<timotheecour> $typeof(1)
00:18:35FromGitter<timotheecour> Eg: $int
00:19:14*Hideki_ quit (Ping timeout: 240 seconds)
00:20:11skrylar[m]i seem to remember there is some bother depending on if you want the fqn or just the local name
00:20:59*konvertex quit (Ping timeout: 260 seconds)
00:22:01FromGitter<timotheecour> see `proc typeToString*(t: typedesc, prefer = "preferTypeName"): string {.magic: "TypeTrait”.}` in tests/metatype/ttypetraits.nim ; I’ll eventually add it to typetraits.nim
00:38:20*krux02 quit (Remote host closed the connection)
00:39:57*Tlongir joined #nim
00:46:25FromDiscord<exelotl> Finally getting the hang of jester, its nice :)
00:47:51FromDiscord<exelotl> Is there an easy way to do csrf tokens though? Seems pretty important
00:50:37*lritter quit (Ping timeout: 264 seconds)
00:50:57*lritter joined #nim
00:53:46FromGitter<gogolxdong> where FileCoin executes Proof of Replication https://github.com/filecoin-project/bellman/blob/master/src/groth16/verifier.rs
00:53:52skrylar[m]jester is neat yea
01:06:35*monok quit (Remote host closed the connection)
01:08:13*ryan_ joined #nim
01:10:55*Tlongir quit (Ping timeout: 260 seconds)
01:17:33*lritter quit (Remote host closed the connection)
01:22:18*dddddd quit (Ping timeout: 256 seconds)
01:29:40*ryan_ is now known as dronger
01:32:59*matthias[m]1 joined #nim
01:37:11*ptdel joined #nim
01:39:14*dadada quit (Ping timeout: 260 seconds)
01:39:57*chemist69 quit (Ping timeout: 252 seconds)
01:41:55*chemist69 joined #nim
01:43:57FromDiscord<Technisha Circuit> Is there a way to use Html directly in Nim? (Don't ask why)
01:46:25disrupteksource code filters.
01:46:35disruptekalso, there's an html dsl module iirc.
01:47:10leorizekarax is one such dsl
01:49:02FromGitter<sealmove> 1) https://hookrace.net/blog/introduction-to-metaprogramming-in-nim/#html-dsl ⏎ 2) https://github.com/juancarlospaco/nim-html-dsl ⏎ 3) https://github.com/pragmagic/karax#hello-world
01:49:21FromGitter<sealmove> Guys, are object variants the closest Nim has to unions?
01:49:43*dadada joined #nim
01:49:54FromGitter<sealmove> I want to change the discriminator at runtime. Is there a better solution than deallocating the object and allocating a new one?
01:50:06*dadada is now known as Guest9003
01:52:48leorizeyou shouldn't have to deallocate
01:53:13FromGitter<sealmove> For example: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eb8b009f0377f16317d9f55]
01:53:13leorizeback in the day `reset` would work but it's too dangerous
01:54:00leorizeyou can keep the memory if you get only the object part out of it :P
01:54:18disrupteknuts, imo.
01:54:20leorizethere's some template to dereference a typedesc[ref T] -> typedesc[T] iirc
01:58:21FromGitter<sealmove> I didn't follow :P
01:59:08PrestigeHow do I convert a cstring to a string?
01:59:33*poohman_1 joined #nim
02:00:41leorizePrestige: `$`, if you have cstring and a size you'd need to do manual index-by-index copying
02:01:39Prestigeit looks like $ just does the trick, do I still need to do the latter?
02:01:59leorizesealmove: so if you can get only the object part of it (the part without ref), you can do something like this: node[] = (HuffmanNode[])(isLeaf: true)
02:02:08leorizewhich will just rewrite the memory instead of reallocating it
02:02:18Prestigefor context it's just an xlib function returning a cstring
02:02:34leorizePrestige: if it gives you a size, then you should do the latter
02:02:43PrestigeThanks
02:04:15FromGitter<sealmove> Hmm, so I keep the same reference but change the underlying object with an assignment? Looks weird.
02:06:56FromGitter<sealmove> If I do want to reallocate, does it make sense to do `node = nil` for the ARC to work?
02:07:00FromDiscord<Varriount> Wasn't there a recent PR that allowed changing the discriminator?
02:08:21leorizeon ly on arc
02:08:24leorizeonly*
02:08:38leorizesealmove: nah, you can just replace the reference
02:11:43*exelotl quit (Ping timeout: 260 seconds)
02:13:16*Guest9003 quit (Ping timeout: 246 seconds)
02:14:57disrupteki really hate van morrison.
02:16:37*muffindrake quit (Ping timeout: 252 seconds)
02:17:59FromDiscord<Rika> why
02:18:49*muffindrake joined #nim
02:19:49*dadada joined #nim
02:20:13*dadada is now known as Guest23650
02:22:15*avatarfighter joined #nim
02:22:35disrupteki'm pretty sure it's his music.
02:22:43FromGitter<sealmove> haha
02:22:58skrylar[m]i think you can just use `.string` on a cstring and it will do the conversion for you too
02:23:12disruptek$cstring
02:31:32*avatarfighter quit (Ping timeout: 260 seconds)
02:33:34skrylar[m]hmmh. looking at siphash for no real reason other than wireguard is using it
02:35:17skrylar[m]probably dont need it yet
02:37:36*minnr joined #nim
02:41:11minnrHi all, I was wondering if there was a way to get the nightly version of nim on Windows using scoop, or if choosenim is the best option.
02:42:36skrylar[m]choosenim is usually what you will be told to use :)
02:43:54*Guest23650 quit (Ping timeout: 256 seconds)
02:45:44minnrThanks, I'll use that instead of scoop. Also, I'm very new to nim and I saw that putting your top-level code in a main procedure, and then calling main(), is best for optimization. Is that still the case?
02:46:10leorizeit's still the case
02:46:58minnrGreat, thanks for your help!
02:49:00FromDiscord<Rika> is there a reason it's more optimized?
02:49:51*dadada__ joined #nim
02:51:06leorizetop-level code are basically globals
02:51:23leorizeand globals don't optimize well
02:51:46leorizeeventually we will make it work great, but for now it's not a priority
02:52:09FromGitter<Willyboar> May i ask something tricky? Let's say i have a proc w/ multiple echos and i want to call it without echos. How can i mute it?
02:52:26leorizedon't use echos :P
02:52:34FromGitter<Willyboar> Hahahaha
02:53:08leorizeyou can easily wrap echo in a wrapper that will only be activated if a magical boolean is true for example
02:53:35FromGitter<Willyboar> ok i will create the same without echos
02:54:48*minnr quit (Remote host closed the connection)
03:04:14*poohman_1 quit (Ping timeout: 240 seconds)
03:05:05*poohman_1 joined #nim
03:08:26*waleee-cl quit (Quit: Connection closed for inactivity)
03:12:45*avatarfighter joined #nim
03:13:07*dadada__ quit (Ping timeout: 246 seconds)
03:13:53FromGitter<sealmove> aaa I am trying to do trees in Nim but I am confused about assignment (shallow vs deep copy).
03:14:13FromGitter<sealmove> I have all my nodes saved in a plain array (`array[1024, Node]`)
03:14:33FromGitter<sealmove> I am sure there are exactly 1024 nodes and no more will be added or removed
03:15:24FromGitter<sealmove> what exactly does something like `myNodeRef.leftChild = nodes[i]` do?
03:15:52disruptekif nodes[] holds refs, it copies the ref. else it copies the value.
03:16:12*thomasross quit (Ping timeout: 272 seconds)
03:16:37FromGitter<sealmove> when you put it like this it sounds simple :P
03:16:51disrupteki try.
03:19:46*dadada joined #nim
03:20:09*dadada is now known as Guest62959
03:22:10FromGitter<sealmove> So when the type is defined like `type T = ref object` then `T()` and `new(T)` do the same thing?
03:22:39disrupteksure.
03:27:55*avatarfighter quit (Remote host closed the connection)
03:28:07*avatarfighter joined #nim
03:31:02*ptdel quit (Remote host closed the connection)
03:32:18*ptdel joined #nim
03:35:47*fredrikhr quit (Quit: Client Disconnecting)
03:39:45*avatarfighter quit (Remote host closed the connection)
03:40:02*avatarfighter joined #nim
03:44:29*nekits quit (Quit: The Lounge - https://thelounge.chat)
03:46:06*nekits joined #nim
04:02:10*Senketsu joined #nim
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:41*supakeen joined #nim
04:15:26*rockcavera quit (Remote host closed the connection)
04:18:55*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
04:19:22*Senketsu_ joined #nim
04:19:49FromDiscord<Rika> https://github.com/de-odex/suru made a pretty meh progress bar library lol
04:20:10*Senketsu_ is now known as Senny
04:30:07*nsf joined #nim
04:30:26FromDiscord<Yardanico> @Rika nice all rights reserved code xd
04:30:50FromDiscord<Rika> i didnt put the license, but its in the nimble file
04:31:01leorizeit doesn't count :P
04:31:08FromDiscord<Rika> i *will
04:31:15FromDiscord<Rika> i didnt but i will later
04:31:28leorizeto be fair you gotta put the license as a header for all files
04:31:41leorizethough I gotta say that not many people actually care about that
04:32:02FromDiscord<Yardanico> Do you need to put it in the header though really?
04:32:09FromDiscord<Anuke> do you *really* have to?
04:33:05leorizedepends on the jurisdiction
04:33:16leorizeusually it's safer to have it (or reference to it) as a header
04:33:16FromDiscord<Anuke> I mean, if the author adds a license to their repository, that should be a sign that they should be okay with you using any source file in that repository under those terms
04:34:03leorizelegal people don't care about "signs" :P
04:34:11leorizebut INAL so don't quote me on that :P
04:34:27*Senny quit (Quit: WeeChat 2.8)
04:34:49FromDiscord<Rika> @Anuke licenses are per-file and per-author
04:35:07FromDiscord<Rika> so if the author says that a license differs on their work, then it differs for that file only
04:35:15FromDiscord<Rika> that -> their
04:35:30leorizenot all licenses are per-file
04:35:53FromDiscord<Anuke> so if someone puts a `LICENSE` in their repo and doesn't add any headers to their files, they can theoretically sue you for using their code in accordance with that license?
04:35:54leorizeGPL for example, applies to the entire "software"
04:36:22leorizedepends on the license wording afaik
04:36:28leorizeusually you should ask a lawyer :P
04:37:24*Senketsu quit (Ping timeout: 244 seconds)
04:38:30FromDiscord<Rika> not a new project w/o yardanico complaining about the license on it i guess
04:38:30shashlickDoes Nim not flash stdout on asserts?
04:38:35shashlickFlush
04:38:40FromDiscord<Rika> why would it?
04:38:49*Senketsu joined #nim
04:39:41shashlickDone debugging could be printed out
04:40:45leorize?
04:44:17*exelotl joined #nim
04:44:25FromGitter<kaushalmodi> Rika: can you also put a gif of the progress bar in action?
04:45:02FromGitter<kaushalmodi> 1) in the repo's readme
04:47:49FromDiscord<Rika> okay ill do that
04:56:02FromDiscord<Rika> done
05:04:26FromDiscord<Rika> oh, MIT also uses "software" as a whole and not code, but afaik some people have used it on individual code files
05:05:24leorizesoftware can be consisted of only one file :P
05:05:46leorizeGPL also uses software as a whole, but they explicitly require that you mark files with the gpl header
05:06:03FromDiscord<Rika> mm, i see
05:06:56leorizeto be on the safe side, I'd just mark every file (and I have to currently, as my library is MPL-2)
05:09:14*poohman_1 quit (Ping timeout: 240 seconds)
05:09:22*poohmaan joined #nim
05:28:18*narimiran joined #nim
05:28:48skrylar[m]bleh. i just have a note that its all mpl, but nobody has really bothered for more
05:29:01*Guest62959 quit (Ping timeout: 264 seconds)
05:34:56*dadada joined #nim
05:35:20*dadada is now known as Guest58503
05:36:03*poohman_1 joined #nim
05:39:35*poohmaan quit (Ping timeout: 256 seconds)
05:53:40*oculux quit (Ping timeout: 256 seconds)
05:57:36*oculux joined #nim
05:58:58*Guest58503 quit (Ping timeout: 272 seconds)
06:04:50*dadada__ joined #nim
06:07:33*kungtotte quit (Read error: Connection reset by peer)
06:07:51*kungtotte joined #nim
06:18:34*ftsf quit (Ping timeout: 240 seconds)
06:19:43*ftsf joined #nim
06:23:00FromDiscord<Technisha Circuit> How would i list everything in a directory with Nim?
06:23:26*filcuc joined #nim
06:24:45FromDiscord<Technisha Circuit> Similar to os.listdir
06:25:50*PMunch joined #nim
06:28:48*dadada__ quit (Ping timeout: 256 seconds)
06:29:28FromDiscord<Never Listen To Beef> walk dir
06:30:18FromDiscord<Technisha Circuit> How do i use it? Also how would i use a python decorator in Nim?
06:30:28FromDiscord<Technisha Circuit> Using Nimpy
06:31:18FromDiscord<Never Listen To Beef> Seems you'd walkdir, then check if each item is a directory and walk that one
06:31:50*poohman joined #nim
06:32:10*filcuc quit (Quit: Konversation terminated!)
06:33:02FromDiscord<Never Listen To Beef> Ah there is walkdirRec
06:33:14FromDiscord<Technisha Circuit> Thanks
06:33:37FromDiscord<Technisha Circuit> > Also how would i use a python decorator in Nim?
06:33:37FromDiscord<Technisha Circuit> Also ^^
06:34:11FromDiscord<Never Listen To Beef> Idk what that even means
06:34:19FromDiscord<Technisha Circuit> Okay then :P
06:34:28*poohman_1 quit (Ping timeout: 256 seconds)
06:34:50*dadada joined #nim
06:35:14*dadada is now known as Guest96426
06:35:34*sz0 joined #nim
06:39:15YardanicoFound about https://github.com/hediet/vscode-debug-visualizer/
06:39:22Yardanicotrying to make a smol nim demo
06:39:42Yardanicobasically how it works is you need to create something in your program which will return a JSON string for the data you want to visualize
06:39:53Yardanicoand then you'll be able to see it visualized when debugging
06:41:28FromDiscord<Technisha Circuit> I don't like that Nim doesn't keep stuff in the module namespace most of the time ;-;
06:41:36Yardanico??
06:41:38FromDiscord<Technisha Circuit> But it's manageable
06:42:46FromDiscord<Technisha Circuit> Like, if i imported `nimpy`, there's pyBuiltinsModule but I'd want it so instead of me just being able to do `pyBuiltinsModule()`, I'd want it to be like `nimpy.pyBuiltinsModule()`
06:43:02Yardanico"from nimpy import nil"
06:43:09Yardanicoand you'll have to fully qualify all stuff
06:43:41Yardanicohttps://nim-lang.org/docs/manual.html#modules-from-import-statement
06:44:31*dddddd joined #nim
06:45:27FromDiscord<Technisha Circuit> Oh nice, thanks!
06:48:17FromDiscord<Technisha Circuit> Also, do you know how I'd use a decorator from a python lib in Nim?
06:48:22Yardanicono
06:48:45FromDiscord<Technisha Circuit> Damn
06:49:05YardanicoI don't use nimpy really
06:49:58FromDiscord<Never Listen To Beef> The real trick isnt using python 😄
06:50:46FromDiscord<Technisha Circuit> Haha
06:51:01FromDiscord<Technisha Circuit> I just like doing stupid stuff, what can i say ¯\\_(ツ)\_/¯
06:51:53FromDiscord<Rika> just found incorrect behavior on suru...
06:52:44*waleee-cl joined #nim
06:53:25FromGitter<bung87> is there KV database write in nim?
06:53:49*solitudesf joined #nim
06:54:06Yardanicoi saw some
06:54:08FromDiscord<Never Listen To Beef> This is where i jokingly say "we have tables"
06:55:30FromGitter<bung87> no tables is not "database"
06:56:05FromDiscord<Rika> wasnt there a redis client in nim?
06:56:41FromGitter<bung87> I know that, I am not intend to just "use"
06:57:20FromDiscord<Never Listen To Beef> I've never seen poes law happen when someone explcitly states that they're joking
06:58:31*Guest96426 quit (Ping timeout: 246 seconds)
07:01:40YardanicoI DID IT
07:01:43YardanicoI ACTUALLY DID IT LOL
07:02:01FromGitter<bung87> I googled https://nikhilism.com/post/2016/writing-simple-database-in-rust-part-1/ just wonder how to implement it in Nim
07:02:01FromDiscord<Never Listen To Beef> Nope you didnt ban me
07:02:03Yardanicohttps://i.imgur.com/AsDrFu9.png
07:02:20Yardanicoand yes as I step in the debugger new values are being added
07:02:41Yardanicogod bless lldb
07:02:45Yardanicotype format add --format c-string NCSTRING
07:03:12Yardanicothis extension supports arrays (can have multiple rows) and graphs
07:03:26FromDiscord<Technisha Circuit> What's a good web library similar to Flask for Nim?
07:03:36Yardanicojester is quite minimal, there's prologue though
07:03:45YardanicoI didn't try prologue yet, but afaik it has more features
07:03:48Yardanicolike middleware and stuff
07:04:09FromDiscord<Technisha Circuit> Thanks!
07:04:25*Romanson joined #nim
07:04:41PMunchHmm, how simple is it to use NimScript in an application
07:04:48FromGitter<bung87> !repo prologue
07:04:49disbothttps://github.com/planety/prologue -- 9prologue: 11Full-Stack Web Framework written in Nim. 15 110⭐ 1🍴 7& 1 more...
07:04:56*dadada__ joined #nim
07:05:07PMunchAnd if you built it into a binary distribution, you'll still have to ship the Nim stdlib right?
07:05:30PMunchOr can the stdlib somehow be be built into the binary?
07:06:12PMunchOh, and how feasable would it be to have a nimscript.(so|dylib|dll)?
07:07:46FromDiscord<Never Listen To Beef> There is https://github.com/Serenitor/embeddedNimScript which forces you to include the compiler
07:08:41FromDiscord<Technisha Circuit> How would i make prologue use a custom port and address?
07:08:54FromDiscord<Technisha Circuit> So if i wanted to host on 127.0.0.1, how would i do that
07:09:16Yardanicoread the docs?
07:09:36FromDiscord<Technisha Circuit> Also `/data/data/com.termux/files/home/.nimble/pkgs/httpbeast-0.2.2/httpbeast.nim(282, 17) Error: undeclared identifier: 'addTimer'`
07:09:39FromDiscord<Technisha Circuit> Okay :P
07:10:10*Vladar joined #nim
07:10:11Yardanicoand check examples like https://github.com/planety/prologue/tree/master/examples/todolist
07:10:17FromDiscord<Technisha Circuit> Thanks :P
07:10:30Yardaniconow lemme try visualizing bubble sort
07:10:53skrylar[m]hah it has the little crowns in the tabs
07:11:30PMunch@Never Listen To Beef, yeah I found that yesterday. Seems interesting, but a bit too opinionated
07:11:47PMunchHow does nimble do this?
07:11:48FromGitter<bung87> or just ask the author @xflywind
07:12:13FromDiscord<Never Listen To Beef> It also lacks quite a bit imo
07:12:37FromDiscord<Never Listen To Beef> Not being able to call procs and the like is quite annoying
07:13:12FromDiscord<Technisha Circuit> Where is addTimer imported from?
07:13:38*BarbaraPalv joined #nim
07:13:58FromGitter<bung87> I guess https://nim-lang.org/docs/asyncdispatch.html#addTimer%2Cint%2Cbool%2CCallback
07:14:10FromDiscord<Varriount> skrylars: What are you referencing?
07:14:24PMunchAh.. Nimble seem to just call "nim e"..
07:14:39Yardanicohaha it works
07:15:17*liblq-dev joined #nim
07:15:48*BarbaraPalv quit (Client Quit)
07:18:20AraqI'm back
07:18:23Araqtoo 4 days off
07:18:26Araq*took
07:18:32Yardanicowelcome back :P
07:18:37FromDiscord<Rika> welcome back
07:18:40PMunchWelcome back
07:18:50PMunchGood to take some time off once in a while
07:19:32FromDiscord<Never Listen To Beef> That's why no one was answering my silly questions like how to add two ints in nim
07:20:03liblq-devwelcome back
07:21:16FromDiscord<Never Listen To Beef> So lib i moved over to the proper vertex method, 1 big array of floats now
07:21:20FromDiscord<Rika> @Never Listen To Beef of course its just a simple system.\`+`(int1.int, int2.int) and totally not just int1 + int2
07:21:43FromDiscord<Never Listen To Beef> Ah yes that's what i was doing wrong, thanks!
07:24:05FromDiscord<Never Listen To Beef> @Rika Look what you encouraged
07:24:05FromDiscord<Never Listen To Beef> https://play.nim-lang.org/#ix=2lCr
07:25:46FromDiscord<Never Listen To Beef> I wonder if reading stuff like that makes him regret creating nim
07:27:19YardanicoI managed to add markers, lemme show a video, it's actually pretty cool
07:28:11skrylar[m]wb araq
07:28:19skrylar[m]Varriount: yards vscode screenshot
07:28:46*dadada__ quit (Ping timeout: 260 seconds)
07:28:52Yardanicoskrylar[m]: I made it even better, lemme show
07:29:07FromGitter<gogolxdong> Is there a rust2nim library?
07:29:07FromDiscord<Rika> @Never Listen To Beef https://play.nim-lang.org/#ix=2lCt
07:29:29FromDiscord<Never Listen To Beef> Yea i realized after sending i could've done that
07:29:41YardanicoC# be like
07:29:45Yardanicosorry java
07:30:02Yardanicoisn't this kinda cool? :P https://www.youtube.com/watch?v=QXneLboQMB0
07:30:03Yardanicoskrylar[m]: ^
07:30:45YardanicoI'm using lldb with https://github.com/hediet/vscode-debug-visualizer
07:30:56FromDiscord<Rika> me a dumbo, how do you use debugger in vscode for nim
07:30:58Yardanicothat extension is language-agnostic since the only thing it needs is json
07:31:02Yardanico@Rika gdb/lldb
07:31:03skrylar[m]its pretty fancy
07:31:14Yardanicothere's nim-gdb for some pretty-printing for nim
07:31:51Yardanicofull src - https://play.nim-lang.org/#ix=2lCu
07:31:56skrylar[m]i do something kind of like that with dumping dot graphs but something nicer would be good
07:31:56Yardanicoand yes I use sugar.collect because I'm lazy
07:31:58FromDiscord<Rika> how do i set it up for vscode, i know how its set up normally
07:32:03Yardanicothe same way
07:32:19Yardanicofor lldb I literally have https://play.nim-lang.org/#ix=2lCv
07:32:29Yardanicousing https://github.com/vadimcn/vscode-lldb
07:33:09Yardanicoand of course compile with --debugger:native
07:34:04FromDiscord<Technisha Circuit> How do i read a file in Nim?
07:34:11Yardanicogo read docs pls
07:34:19Yardanicohttps://nim-lang.org/docs/io.html
07:34:26FromDiscord<Technisha Circuit> Thanks :P
07:34:43*dadada joined #nim
07:35:06*dadada is now known as Guest17205
07:36:42FromDiscord<Rika> bruh xd
07:46:16skrylar[m]i spent a couple hours putting kanboard on a raspberry before learning that was a dumb idea
07:46:25skrylar[m]raspberries are slow web servers xD
07:47:44FromDiscord<Technisha Circuit> Exception handling is exactly the same as Python and i love it
07:47:56skrylar[m]for now yea
07:48:01Yardanicoskrylar[m]: it's already different
07:48:04Yardanico--panics:on exists :P
07:48:06Yardanicoand we have defects
07:48:30skrylar[m]eh. i still prefer exceptions
07:49:18FromDiscord<Technisha Circuit> How many spaces are preferred for an indent?
07:49:24FromDiscord<Rika> 2
07:49:38Yardanicoyeah, 2
07:49:50skrylar[m]am partial to 3 becuse reasons
07:53:44FromDiscord<Technisha Circuit> Thanks
07:57:52Yardanicoso I finished creating the Nim demo, will probably PR it to https://github.com/hediet/vscode-debug-visualizer
07:58:32skrylar[m]there were some old (and i don't have them anymore) discussions on this from other communities, and it was basically that linus uses 8 because he thinks if you are nesting too much you are already screwed and the large spacing encourages you not to do it, 4 is more or less a global default (kakoune gives you 4, many many many standards are 4.) i always liked the way 3 looked but its the least common.
07:58:34FromDiscord<demotomohiro> Project website link in this page seems wrong.
07:58:34FromDiscord<demotomohiro> https://nimble.directory/pkg/nimterop
07:58:34FromDiscord<demotomohiro> I think it should link to
07:58:34FromDiscord<demotomohiro> https://github.com/nimterop/nimterop
07:58:54*Guest17205 quit (Ping timeout: 256 seconds)
08:02:38liblq-devwhat would be a good idea for efficient GL uniform storage? I want to allow the user to still use regular tables, but at the same time, I want to have a more efficient representation
08:02:57liblq-devI was thinking about iterators, but then you can't really pass an iterator as an argument to a proc
08:03:01liblq-devunless it's a closure iterator
08:04:17liblq-devbut I'm worried that the overhead of a closure iterator would be pretty high, I'd like to keep it to a minimum
08:04:55*dadada__ joined #nim
08:06:20Yardanicohttps://github.com/hediet/vscode-debug-visualizer/pull/51
08:06:20disbotAdd Nim demo
08:06:48FromGitter<bung87> why not just using ` closure iterator`?
08:07:03Yardanico"overhead"
08:07:06liblq-dev@bung87, I'm not sure about the overhead
08:07:09skrylar[m]you get an alloc every time you use a closure
08:07:11liblq-devidk how high it is
08:07:33*lmariscal9 joined #nim
08:07:45liblq-devhmm
08:07:51skrylar[m]i'm not sure what you mean by efficient uniform storage and regular tables. opengl doesn't use tables?
08:08:02*Vladar quit (Quit: Leaving)
08:08:15liblq-devit probably uses a regular array internally
08:08:16FromGitter<bung87> hmm I never thought of it, as it is a language feature..
08:08:30Yardanico@bung87 well you know, language features can have a cost too
08:08:35liblq-devby efficient I mean, I regenerate them every frame and the overhead is low
08:08:36Yardanicoand it applies to all languages out there
08:08:47liblq-devie. it's fast
08:08:49*kitech1- joined #nim
08:08:50Yardanicoit's just that in languages like python most people don't care :D
08:09:08skrylar[m]uniforms can be literally anything :shrug:
08:09:22skrylar[m]view matrix? skeleton parameters?
08:09:41Yardanicohttps://github.com/halonium/halonium cool stuff
08:09:58liblq-devguess I'll try closure iterators, we'll see how it goes
08:10:09FromGitter<bung87> yeah that's right, as it just a keyword, what else approach definately more than a word..
08:10:26Yardanicoclosure is a pragma first of all
08:10:46FromDiscord<demotomohiro> I think cost of closure iterator is small compared to cost of creating copy of state of GL unform in memory.
08:10:54*deepend_ joined #nim
08:11:23skrylar[m]its an alloc every frame, which is the kind of overhead you usually avoid
08:12:38skrylar[m]there was a talk about this the other day in this channel because someone was asking if they could store the closure on the stack instead and they were told no
08:12:56FromDiscord<Recruit_main707> halonium is the cooler requests??
08:13:15FromDiscord<Recruit_main707> it looks so cool
08:14:00Yardanicoit's for browser automation
08:14:05Yardanicolike selenium
08:14:19FromGitter<bung87> it alloc memory for `closure iterator` its self?
08:14:45*vqrs_ joined #nim
08:15:30liblq-devit allocates memory for the closure. every. single. frame.
08:15:33FromGitter<bung87> like a variable declaration for every time it calls?
08:15:37liblq-devworse
08:15:48liblq-devbecause variable decl are done on the stack which is faster to access
08:15:52*vqrs quit (*.net *.split)
08:15:53*kitech1 quit (*.net *.split)
08:15:53*lmariscal quit (*.net *.split)
08:15:53*deepend quit (*.net *.split)
08:15:53*cornfeedhobo quit (*.net *.split)
08:15:54*lmariscal9 is now known as lmariscal
08:15:54liblq-devclosures are allocated on the heap
08:16:28*cornfeedhobo joined #nim
08:16:44liblq-devbut idk if there's a better solution, everything else seems to involve an alloc too
08:17:10FromGitter<bung87> I think I get the point , no-closure just get the proc pointer right?
08:21:59skrylar[m]wouldn't you just store the uniform on the heap or inside an object somewhere, modify it each frame and then upload from the same buffer each time?
08:24:44liblq-devhmm
08:27:16FromDiscord<demotomohiro> ``proc getUniform[T](progObj: GLuint; uniformName: string): T =``
08:27:38liblq-devno, I don't want to *get* the uniforms
08:27:40liblq-devI want to set them
08:28:14*dadada__ quit (Ping timeout: 240 seconds)
08:28:41Yardanicomerged https://github.com/hediet/vscode-debug-visualizer/pull/51
08:28:41disbotAdd Nim demo
08:30:30FromDiscord<demotomohiro> ``proc setUniform[T](progObj: GLuint; uniformName: string; val: T) =``
08:31:01FromDiscord<demotomohiro> is not good?
08:31:17FromDiscord<Recruit_main707> Yardanico good stuff
08:31:55skrylar[m]demotomohiro: you would look up the index for where the uniform goes once and reuse it, not use the string lookup there each time
08:33:09skrylar[m]then some version of `glUniform` to actually upload
08:34:52*dadada joined #nim
08:35:16*dadada is now known as Guest26999
08:38:22*krux02 joined #nim
08:40:11*xet7_ joined #nim
08:43:14*xet7 quit (Ping timeout: 240 seconds)
08:45:38FromGitter<sealmove> #@%^ yeah! I finally did it! :) decompression works: https://github.com/sealmove/LZ77
08:46:16FromGitter<sealmove> (no idea why the fonts look so bit in gitter)
08:46:20FromDiscord<Never Listen To Beef> Now if you never compressed in the first place you wouldnt have said the last sentence 😛
08:46:42FromGitter<sealmove> I didn't. Microsoft did :P
08:47:20*xet7_ is now known as xet7
08:47:29*xet7 quit (Quit: Leaving)
08:47:58*xet7 joined #nim
08:48:38FromGitter<sealmove> Wow! I spent 5 days on 150 lines of code
08:48:57FromDiscord<Never Listen To Beef> How writting shaders feels
08:51:48skrylar[m]some lines of code are more important than others
08:52:27Yardanicolike nim's tlsf-based allocator
08:52:32Yardanico1k lines, but really important :P
08:52:32FromGitter<sealmove> This is the secord open-source implementation of this decompression algorithm. The only other one that I know is this: https://github.com/libyal/libfwnt/ but well... it's C, a lot messier than 166 lines :)
08:52:57Yardanicohttps://github.com/nim-lang/Nim/blob/devel/lib/system/alloc.nim
08:53:21skrylar[m]Yardanico: isn't that going kaput with arc/newruntime
08:53:24Yardanicono?
08:53:32Yardanicothe allocator is not related to the GC really
08:53:40Yardanicoand nim's allocator is really great
08:53:49skrylar[m]it says it implies --useMalloc
08:54:07Yardanicoarc doesn't imply -d:useMalloc
08:54:18Yardanicoactually arc with -d:useMalloc is much slower than without it
08:54:25Yardanicoit's only for debugging
08:54:31Yardanicoor porting to new OSes
08:54:32Zevvno it doesn't. But it is easier to debug with -d:useMalloc
08:54:32Zevvright
08:54:58Yardanico--os:any -d:useMalloc and you can use nim on any platform which has a C compiler and standard C library ported
08:55:03Zevvespecially when doing valgrind for example. It makes one Nim alloc match one libc alloc
08:55:07Yardanicoat least simplest parts of it
08:55:22YardanicoZevv: yeah, but even for simple programs -d:useMalloc can result in 22k allocs for example :P
08:55:40Yardanicoand without it there's only 1 allocation
08:55:43Zevvsure.
08:55:48skrylar[m]--newruntime use an alternative runtime that uses destructors and that uses a shared heap via -d:useMalloc [https://nim-lang.org/docs/nimc.html] :E
08:55:58Yardanicoarc is not newruntime
08:56:03Yardanicothey're different
08:56:09Zevvit's a mess, right :)
08:56:17Yardanicowell they are similar in some ways but they're not the same
08:56:22Zevvfirst some of the undead corpses have to be properly killed and buried
08:57:37FromGitter<bung87> @sealmove I guess most time costs in reading...
09:00:00planetis[m]sealmove: nice
09:00:16planetis[m]Yardanico thanks i will fix it
09:03:06*sz0 quit (Quit: Connection closed for inactivity)
09:03:33FromGitter<sealmove> Yes, my mistake was that I started writing code before reading the specs 10 times
09:04:01skrylar[m]ouch. did that for cassowary. spent a month trying to figure that out
09:04:45FromGitter<sealmove> cassowary?
09:05:05skrylar[m]linear constraint engine for guis
09:08:26AraqYardanico, er the allocations are there either way
09:08:43Araqwith our allocator they are simply not counted properly by some tools
09:08:49Yardanicoah okay
09:08:59Araqbut yeah, our alloator is awesome tech
09:09:15Araqit sucks for multi-threading though, uses a single lock
09:09:46Araqthat said, that can be an advantage for hard realtime systems because nobody understands hard realtime :P
09:10:51Araqor to put it differently: a (fair!) lock around an O(1) operation keeps the O(1)
09:11:38Araqwhen the number of threads is bounded.
09:22:03planetis[m]is it just me or nim devel is broken with --gc:arc?
09:22:47planetis[m]no its me
09:23:27Yardanicoplanetis[m]: it depends on what you're trying to compile with arc :P
09:24:12planetis[m]no I was trying to make a new branch to change that "use move" message in injectdestructors
09:24:55planetis[m]what should it say though? should i just remove it?
09:24:59Yardanico?
09:25:06Yardanicowho?
09:26:23FromDiscord<Never Listen To Beef> When?
09:26:28Yardanicowhy?
09:26:34FromDiscord<Never Listen To Beef> How?
09:26:37Yardanicobtw https://github.com/kostya/benchmarks/pull/252/files
09:26:38disbotAdd packedjson for Nim
09:26:57Yardanicoin matmul benchmark arraymancer is the best there btw
09:27:10Yardanicobeats everything, including julia
09:28:21FromDiscord<Never Listen To Beef> Packed json makes it mor performant than python then eh?
09:28:50FromDiscord<Never Listen To Beef> I previously seen that benchmark and was astounded that nim was slower than python and used more memory
09:29:01Yardanicobecause json is implemented differently
09:29:10Yardanicopython for me is 2s
09:29:14Yardanicoslower than Nim
09:29:22YardanicoI mean CPython, not PyPy
09:29:34planetis[m]"passing '$1' to a sink parameter introduces an implicit copy use 'move($1)' to prevent it"
09:29:49Yardanicoplanetis[m]: can you show the code?
09:29:56Yardanicobut it's a hint
09:30:01Yardaniconot even a warning
09:30:07Yardanicoso you don't *have to* to do that :)
09:30:28*Romanson quit (Quit: Connection closed for inactivity)
09:30:30planetis[m]yardanico: there was a discussion https://forum.nim-lang.org/t/6309
09:30:34*konvertex joined #nim
09:31:23FromDiscord<Yardanico> You can see I replied there lol
09:31:36planetis[m]btw that isClosureEnv check at: https://github.com/nim-lang/Nim/blob/devel/compiler/injectdestructors.nim#L397 doesn't work correctly
09:32:06planetis[m]because in my code i get messages like: Hint: passing ':env.place22' to a sink parameter introduces an implicit copy; use 'move(:env.place22)'
09:32:06FromDiscord<Yardanico> Fix it :P
09:32:19FromDiscord<Yardanico> Well it's the same for async
09:32:34FromDiscord<Yardanico> Try compiling any not small async app with orc
09:32:38FromDiscord<Yardanico> You'll see pages of these hints
09:33:00planetis[m]haha
09:33:10FromDiscord<Yardanico> https://forum.nim-lang.org/t/6309#38907 but read this too
09:34:39planetis[m]yes so deleting it, is not what we want
09:35:08planetis[m]thought it would be easy 😂
09:39:19*abm joined #nim
09:39:50Araqalmost whenever Python is "faster" than Nim, you're measuring C code Python happens to use
09:40:50Araqwhereas our code is usually handicapped by our requirements for portability, including portability to Nim's VM so everything can work at compile-time
09:43:00Araqit's annoying.
09:47:27FromGitter<bung87> that's right, most cases Nim is x faster than Python
09:47:31*krux02 quit (Remote host closed the connection)
09:50:29Araqif you want to benchmark language implementations, benchmark language features, not standard libraries. if you instead care about "bugah bugah *in practice*" then at least pick a benchmark that reflects your application domain.
09:51:03Araqfor example, as a compiler writer I don't care about json's performance
09:51:15Araqnor about matrix multiplications
09:52:46*natrys joined #nim
09:55:09*ryan_ joined #nim
09:57:58*dronger quit (Ping timeout: 256 seconds)
09:58:46*exelotl quit (Ping timeout: 246 seconds)
09:59:55*Jim21 joined #nim
10:00:16*Trustable joined #nim
10:00:36*Jim21 quit (Remote host closed the connection)
10:01:48FromDiscord<Rika> but the application domain depends on who's looking, no?
10:03:27Yardanico?
10:04:21FromDiscord<Rika> the application domain to be applied on the benchmarks are not dependent on who is running them, but dependent on who is looking at them, no?
10:04:27skrylar[m]i thought about tossing that tldf thing in a module for disc files a time or two
10:04:33FromDiscord<Rika> i have to go, it is late
10:04:54skrylar[m]its rare but some (mostly database?) formats also alloc space
10:05:48AraqRika: well yes.
10:18:54*exelotl joined #nim
10:27:12*NimBot joined #nim
10:31:12FromDiscord<Zed> It's strange how simple nim is
10:31:17FromDiscord<Zed> well not strange
10:31:47FromDiscord<Zed> more like, why do i keep coming back to it from other languages
10:35:05FromDiscord<Zed> i have spent the past week coding in swift but now im re-writing the entire program in nim
10:35:10Yardanicolel
10:35:41dom96You tell us, why do you prefer Nim over Swift?
10:36:20skrylar[m]zed: because stuff in nim just works. lol
10:40:55*Trustable quit (Remote host closed the connection)
10:42:46*Trustable joined #nim
10:47:36FromDiscord<Zed> @dom96 Swift is great dont get me wrong but somethings are just over complicated eg opening a file, rather then saying openFile() or something you have to make a URL object and then some super long method call just to open up the file
10:49:14FromDiscord<Zed> it's the little things that add up that i dont like
10:53:35dom96I see. Interesting
10:55:08FromDiscord<Zed> also i love this discord because there's 2 other guys here called zed
10:56:17FromGitter<sealmove> I agree. Imagine the sensation of liberty compared to being forced to make classes for everything. Nim is really amazing at being simple and complex at the same time :)
11:01:46FromDiscord<Zed> yup, although i dont actually mind classes and swift doesn't force you to use them
11:05:46*Guest26999 quit (Ping timeout: 260 seconds)
11:06:19*fredrikhr joined #nim
11:06:39*dadada joined #nim
11:07:03*dadada is now known as Guest15212
11:10:07FromDiscord<Yardanico> But do you get method call syntax without classes? :p
11:11:46FromGitter<sealmove> Even if the language doesn't force you, usually it makes it painful to go the other way
11:11:53FromDiscord<Zed> I'm not entirely sure what that is
11:12:39FromGitter<sealmove> @Zed https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax
11:18:46FromDiscord<Zed> ah so just weird ways of calling the same function lol
11:19:49FromDiscord<Yardanico> Not really weird xd
11:24:29FromDiscord<Yardanico> a.b() == b(a) allows for a lot of cool stuff
11:31:42FromGitter<bung87> that's why I hate js , need rember operation position which is left which is right..
11:42:52skrylar[m]sealmove: https://ariya.github.io/FastLZ/ =o
11:46:26FromDiscord<Zed> how have you guys found the embedded space with nim?
11:46:40FromDiscord<clyybber> ask Zevv :)
11:47:08Yardanicowell I don't do embedded but it's much better with --os:any and gc:arc
11:47:11Yardanicowhich are both relatively new things
11:48:10FromDiscord<Zed> @clyybber Do you know if he has a github?
11:48:28FromDiscord<clyybber> sure, https://github.com/zevv/
11:48:57*Hideki_ joined #nim
11:49:14FromDiscord<Zed> thanks!, he didn't show up for me
11:49:36*Hideki_ quit (Remote host closed the connection)
11:52:25FromGitter<sealmove> @skrylar oh cool! I definately missed this
11:53:41FromGitter<sealmove> Honestly the microsoft documentation was very decent and it includes sufficient pseudocode. I am just not used to this type of work. For someone experienced it should be a couple of hours work.
11:55:59FromGitter<sealmove> Though it does look a bit different from what I implemented. LZ77 is used for a lot of stuff. I think ariya's implementation is focused on other file formats than Windows Prefetch.
11:58:39AraqI think we need classes in a very mild form, pending an RFC
11:59:32Araqit would solve some problems and not introduce new ones (famous last words...)
11:59:40FromDiscord<Yardanico> As a language feature or sugar with macros?
11:59:56Araqas a language feature, no new syntax required
12:00:09Araqjust some tweaking of today's rules
12:00:10FromGitter<alehander92> oh no
12:00:26FromGitter<alehander92> can't it be somehow simulated with current feature
12:00:28FromDiscord<clyybber> Araq: Maybe simply a parameter annotation to bind the proc to a parameter's type?
12:00:38FromDiscord<clyybber> alehander92: Its about type bound ops
12:00:46FromDiscord<clyybber> Not classes at runtime I think
12:01:08Araqclyybber: I don't have an annotation in mind, but probably people prefer one
12:01:10FromDiscord<Yardanico> "oh no" is usually used in a joking manner anyway :)
12:01:41Araqand yeah, this is awesome. before I fleshed out my proposal, be against it.
12:02:26Araqbecause Araq is known to destroy Nim's design. :P
12:03:13FromGitter<alehander92> sorry, it was an actual `oh no`
12:03:18FromGitter<alehander92> but i shouldnt judge like that
12:03:24FromGitter<alehander92> ah is it type classes
12:03:35FromGitter<alehander92> traits*
12:04:19FromGitter<alehander92> can we get pattern matching into fusion btw :D
12:04:28FromGitter<alehander92> (when talking about RFC-s)
12:05:26FromDiscord<Yardanico> Yeah I wonder which kinds of libraries will be accepted into Fusion
12:06:02*supakeen quit (Quit: WeeChat 1.9.1)
12:06:42*supakeen joined #nim
12:07:18Araqhmm I think 'fusion' is still misunderstood
12:07:42Araqalehander92: you need to become a fusion core developer to get your pattern matching into 'fusion'
12:08:21FromGitter<sealmove> Araq wtf, don't tease us like this!
12:08:57Araqhey, sorry. but we want to be able to maintain it
12:09:30FromGitter<alehander92> Araq i actually want to re-RFC it and get a combo of patty+gara+ast_pattern_matching there :D
12:09:57FromGitter<alehander92> but i am just bad at fusion reactors and nuclear stuff
12:10:13Araqbut yeah, "pattern matching" is definitely insides fusion's domain
12:10:17FromGitter<alehander92> (combo like a unified single lib)
12:13:54*natrys quit (Quit: natrys)
12:24:09YardanicoI wonder if disruptek will be streaming today
12:24:26Yardanicodisbot: do you know by any chance?
12:27:28Araqhe will
12:27:39AraqI'm back so he'll stream :P
12:27:43Yardanicohaha
12:29:04Yardanicowell he did some s̶l̶a̶c̶k̶i̶n̶g̶ ̶o̶f̶f̶ streams in last few days
12:29:19Yardanicolike when we tested what would happen if you watch your own stream for too long
12:29:56Yardanicohttps://www.twitch.tv/videos/614831993 01:25:00
12:31:36skrylar[m]lua coding, it looks like
12:31:38Yardanicoand then I was too sleepy and left my own stream open for 14 hours acidentally
12:31:59Yardanicoskrylar[m]: https://github.com/disruptek/lunacy
12:32:14Yardanicodisruptek came to like lua a lot, said he'll maybe use it for configs and stuff :P
12:32:18Yardanicobecause it's fast
12:32:24YardanicoI mean as config files
12:34:14skrylar[m]some people do. premake used to be a relevant ting
12:38:53alexander92i had a big discussion once with zah
12:39:08alexander92about using language vs declarative format for config
12:39:17*rockcavera joined #nim
12:39:28alexander92i still find the first idea (using lua/nim for config) a bit radical
12:40:10alexander92people say that https://dhall-lang.org/ fixes a lot of this stuff .. but i never really tried it, has anyone tried that one?
12:40:18Yardanicowe talked about that one here already P
12:40:19Yardanico:P
12:40:25alexander92so whats the conclusion :P
12:40:29Yardanicono
12:40:37alexander92CHANNEL SAYS NO
12:40:38Yardanicohttps://irclogs.nim-lang.org/20-04-2020.html#21:09:20
12:40:42Yardanicostarts here
12:42:22Yardanicoalexander92: THE NIM GODS HAS SPOKEN
12:42:44alexander92you're just men, you men!
12:42:59alexander92ughhh
12:43:06alexander92well its not so much about turing completeness
12:43:10alexander92its just about introspection
12:43:23alexander92its much easier to introspect/modify a data structure
12:43:31alexander92compared to .. actual code in a custom language
12:43:43alexander92so thats why configs in the first case seem better to me
12:45:03FromGitter<bung87> if configuration using language better no other languages, just nim
12:45:04PMunchI was thinking of using NimScript as a configuration language for my window manager
12:45:10PMunchHence my questions earlier
12:45:32alexander92also, how do people change settings with UI etc
12:45:36alexander92if its mapped to code
12:45:56alexander92i think people try to mix *plugins* with *config* in those cases
12:45:56PMunchFor me it's mostly a question of being able to re-use Nim without having to write my own parser for a config format and support whatever features I want
12:46:05alexander92if i need to add custom logic, thats a plugin/extension
12:46:33PMunchI know that with Nim and meta-programming I can have a nice config syntax and be able to add functionality to it
12:46:36alexander92but you can just one of the many existing formats that people/tools just understand
12:46:50PMunchWell, I was using TOML
12:47:12PMunchBut it didn't really work for my usecase as I can't have repeated keys
12:47:21PMunchSo binding multiple keys became an issue
12:47:22alexander92but what features would you need for a format .. from a programming languages
12:47:23FromGitter<bung87> then make it as a package
12:47:52alexander92disruptek the lua dsl looks cool
12:47:55PMunchWell one thing that would be nice is to have it dynamically change based on how many screens I have
12:48:19PMunchSo I can use the same config on all my machines
12:48:20FromGitter<bung87> I think any script language would be fine
12:48:30PMunchAnd detect screen resolutions
12:48:47PMunch@bung87, Nim has the benefit of macros though
12:48:57PMunchSo you can make it look like a configuration language for the common cases
12:49:06FromGitter<bung87> https://github.com/qiniu/qlang
12:49:31PMunchLike in say a nimble file that looks like a plain config file, but then suddenly there's a Nim ternary in there
12:49:45FromGitter<bung87> the end developer may want more dynamic power
12:50:04alexander92bung87 yeah, but my point is that there is a difference between config and extensions
12:50:18alexander92getting a bit of dynamic power makes then much harder a lot of other stuff
12:50:28PMunchLike what?
12:50:45alexander92config editing/linting by all kinds of tools
12:50:49alexander92representing in the UI
12:50:52FromGitter<bung87> you can take the idea from qlang
12:50:57alexander92programatically changing it
12:51:15alexander92e.g. you cant just show a form for your json data structure
12:51:27alexander92because now you have to represent somehow "if conditions"
12:51:29*Guest15212 is now known as dadada
12:51:30alexander92and "loops"
12:51:45alexander92and a way to flawlessly edit that back in source code
12:51:55PMunchYou don't have to
12:52:30PMunchAs I said, you use the basic features and macros for the 90% usecase, and then allow the user to use the extra power for the last 10%
12:52:47dadadaI don't completely understand the logic behind ident"foo" in macros and procs that are inside macros... I now get undeclared errors, and the only change I made is to assign the ident to a ref object field, before I assigned it to a var ... why should that make something undeclared?
12:52:55alexander92but you assume an user that wants to edit source code
12:53:03dadadaalso I can't reproduce it on playground yet
12:53:09alexander92i dont think i explained it well :
12:53:22alexander92if i want the whole config to be mappable to menu in the UI
12:53:28PMunchAh, I don't
12:53:34PMunchBecause there is no good reason too
12:53:40alexander92this looks like a much harder problem with custom languages
12:53:52alexander92i mean, its doable i guess
12:53:52PMunchAll my configurations are text-based
12:53:57alexander92but thats you
12:54:05PMunchWell, that's most Linux people..
12:54:07alexander92many users have different preferences
12:54:09dadadaundeclared identifier: 'foo' <- but why
12:54:17Yardanicobecause it's undeclared? :P
12:54:20alexander92you'd be surprised imo
12:54:31alexander92ok, so if i change my settings
12:54:37Yardanicodadada: ident"foo" means that you already have (or the user will have) some symbol with the ident "foo"
12:54:44Yardanicoand want to use it in your macro's nodes
12:54:46FromGitter<bung87> I think alexander told the real use case
12:54:53dadadaYardanico: when I var blub = ident"foo" # works, when I refobj.field = ident"foo" #why is it now undeclared?
12:54:55PMunchBut again, you can make a UI that will work for 90% of all use-cases and have a fallback for the last 10%
12:55:08alexander92the wm would monitor my file (or i would trigger it) and it would reinterpret the config ?
12:55:14alexander92PMunch eh .. i am not sure
12:55:27alexander92e.g. in my UI the user toggles `.flow`
12:55:35dadadaYardanico: I know that, but where's the difference between a local var and a local refobj.field that causes this error?
12:55:44YardanicoI can't understand without more code :D
12:55:46alexander92but in the config script somewhere he changes is in the loop: how do you even guess that
12:55:52alexander92to change the code correctly
12:55:56dadadaYardanico: can't reproduce on playground :-(
12:56:02Yardanicobut can locally?
12:56:04PMunchYou could even force the entire thing into one DSL that restricts the syntax slightly, meaning it's easier to parse. So if a field is set to an if statement for example, you represent it with a text field instead of whatever input box you had.
12:56:05Yardanicosend the code :D
12:56:26alexander92PMunch and you enter source code there?
12:56:29dadadaYardanico: working on it, my feeling is once I can reproduce it I can solve it myself ... :D
12:56:33PMunchYeah
12:56:43alexander92and also , another thing, you cant merge/inherit configs
12:56:56alexander92override*
12:57:01PMunchWith the assumption that 90% of the 10% of those who need programming features will just need an if or two
12:57:01alexander92e.g. config in ~/.config then overriden partly by local config
12:57:03Yardanicodadada: don't worry, minimizing stuff is fun too (I can say that after spending about 1.5 hours on minizing a nigui arc issue)
12:57:08Yardanico:P
12:57:10PMunchSo you don't really need syntax highlighting and such
12:57:12alexander92i mean, you can .. but i guess you need to interpret them in order in the same env
12:57:14Yardanicobut it's all for the greater good
12:57:27PMunchalexander92, that's just the same as any config
12:57:38alexander92well merging data structures is not hard :)
12:57:55alexander92but yeah, with some work the other might be not hard too
12:58:05PMunchYou start of with a set of variables, you run a Nim script that can change the state, you run another that can change the state further, and after you've run all your scripts in order you have you final state.
12:58:08PMunchEasy-peasy
12:58:32alexander92yeah, just a full blown program run instead of looking at two data structures
12:58:38Araqfwiw I gave up on nim.cfg, it's simply too messy, I hardcode the logic in extccomp.nim instead
12:58:39alexander92and now you can debug your configs
12:59:08Araqconfiguration is worse than programming
12:59:19alexander92but an `if` or two is all one needs, one can just do that with fields somehow again
12:59:23Araqas programming is debugable
12:59:42alexander92yeah on the other hand one can say that real config = config + the code that interprets it anyway
12:59:59alexander92so you still need to debug the actual main app then
13:00:19AraqI'm still looking for the proof that dhall doesn't give you the simple lambda calculus
13:00:35alexander92Araq i dont know dhall, i am arguing for simple toml/yaml/json files
13:00:56alexander92but i guess they are all valid choices, i also do like the `if` support in nim.cfg
13:00:56PMunchTrue, and why would I spend my time writing a custom configuration thing that has all these complex rules when I can simply say "here are my variables, modify them until you're happy" and then possibly run some sanity check on them.
13:01:23dadadaYardanico: https://play.nim-lang.org/#ix=2lDT note how b works and c throws this undeclared error
13:01:32PMunchFirst thing I did when I was using TOML was to create a custom syntax for variables
13:01:44alexander92PMunch but you dont have to write your own format
13:01:48PMunchSo that I could have $mod set to the modifier key I wanted to use and then refer to that later on
13:01:51alexander92one needs to adapt *a bit* to an existing one
13:01:56dadadaYardanico: sorry, I take it back, now they both don't work ... but why
13:02:01PMunchSo I could change the modifier in one place
13:02:17dadadaYardanico: ah, sorry, I know why
13:02:23Yardanicobecause haha is not declared?
13:02:26PMunchalexander92, until you find a scenario that just won't work in the format you've chosen
13:02:27dadadaYardanico: the testcase isn't finished, wait a second
13:02:33dadadaYardanico: yeah, but in the original itis
13:02:53alexander92PMunch i think with enough work one can make all those cases work
13:02:58alexander92you can make ui for code
13:03:07alexander92i can make very custom yaml file
13:03:08alexander92:D
13:03:13PMunchAnd now you're stuck either forcing it into some clunky structure, abandoning the feature entirely (or make it not very configurable), or change/make a proprietary extension to the configuration format
13:04:00PMunchSure you can, but why? Sounds like a lot of work for very little gain
13:04:13alexander92but for me your solution sounds like a lot of work
13:04:41alexander92its literally embedding a custom script engine + all kinds of other harder stuff on top
13:04:48alexander92i still cant easily make a menu for it
13:05:02alexander92i still dont understand how to toggle programatically `field2`
13:05:20alexander92without just parsing the ast and searching for the field and updating it again
13:06:46alexander92or doing some global text replace and hoping one hasnt done *later* some form of for name, value in fields(myObj): myObj.`name` = variable
13:07:22*thomasross joined #nim
13:07:25*lritter joined #nim
13:07:26dadadaPMunch: cannot open file: macroutils is not working on playground!
13:07:38PMunchWell.. Yeah getting NimScript to work might prove tricky
13:07:43PMunchJust started looking at that :P
13:07:51alexander92i mean, it might work well for your usecase , just i think one should be careful with it and not apply it for all kinds of projects
13:07:53Yardanicodadada: well playground isn't only for testing
13:07:57Yardanicoit's also for sharing code
13:07:57PMunchBut once I make a library that makes that super simple, then it will be easy!
13:08:02Yardanicoeven if you can't run it on playground
13:08:11PMunchdadada, that's strange
13:08:11alexander92PMunch :D thats a good attitude i guess
13:08:37alexander92sorry it might be very easy to do for your wm, just wanted to show another viewpoint for other kinds of apps/projects
13:09:12PMunchYeah I can see how the graphical side might be tricky
13:10:29PMunchAlthough you could have a "graphical.nims" file that says on the top ## This file is automatically generated, do not edit. And then have your program run all the scripts first and then this last.
13:10:33dadadaYardanico: I think the issue I had is that normal quote do can't deal with something like quote do: var `refobj.ident` = "whatever" <- that's why it's probably ending up as undeclared while the var `ident` = "whatever" version worked, so I wanted to see if it works with superQuote, and if stuff like that works with superQuote it should eventually replace the normal quote do IMO
13:11:03PMunchThen the graphical program could run all the other scripts to populate the fields in the UI and just generate the things you do in the override in a clean file every time.
13:11:25PMunchSo if you wanted to do something with code to override what you did in the GUI you need to put it in a file with precedence
13:12:01PMunchBasically saying "if you want programming features you have to write it as code" (although you could support a subset of features in the GUI)
13:12:47dadadano superQuote can't do it either
13:12:59PMunchdadada, quote do doesn't do that, superQuote can
13:13:05PMunchIt's one of the reasons I wrote it
13:13:08alexander92PMunch but what i was afraid for was that
13:13:17alexander92you might change something declaratively from the ui
13:13:18FromGitter<kaushalmodi> @timotheecour Are you here?
13:13:23alexander92but to not detect that the code also changes it
13:13:23dadadaPMunch: superQuote gets me Error: request to generate code for .compileTime proc: Lit
13:14:06dadadaPMunch: https://play.nim-lang.org/#ix=2lDW
13:14:28PMunchHuh..
13:14:36PMunchThe playground doesn't seem to have any packages
13:14:39PMunchWeird
13:15:11dadadatest it locally, superQuote can't handle this use case
13:16:08PMunchHmmm
13:16:19PMunchWait
13:16:35*thomasross quit (Ping timeout: 260 seconds)
13:18:04PMunchThis works just fine: http://ix.io/2lDX
13:18:50PMunchSo does this: http://ix.io/2lDY
13:19:10PMunchIt's the quote do you have after the superQuote that creates an error
13:19:26YardanicoI don' think `r.ho` is really supported though
13:19:32Yardanicoor is it? in superQuote?
13:19:41PMunchIt is in superQuote
13:19:53PMunchAs I said, that's part of the reason I wrote it in the first place :)
13:20:00PMunchI wanted to be able to do stuff like that
13:20:12*dddddd quit (Ping timeout: 256 seconds)
13:22:29AraqsuperQuote, yay
13:22:48dadadaPMunch: why would the second quote do create the error though, the (super)quote dos are supposed to return NimNodes, so I'd expect superQuote to replace `r.ho` with the identifier name, and then I see no reason why the quote do would need to complain, the hard work would be done by your superQuote already? no?
13:22:57PMunchAraq, huh?
13:23:02YardanicoPMunch: he likes it maybe :P
13:23:22PMunchYardanico, or he hates it :P
13:23:26Yardanicoyeah :D
13:23:37Yardanicoeither way that means it's good enough it caught his attention
13:23:39PMunchdadada, you'd think so, but quote works in mysterious ways
13:24:00PMunch"You're the worst pirate I've ever heard of" comes to mind
13:24:28AraqI like the name :-)
13:24:47PMunchHaha, okay :)
13:25:05PMunchI couldn't think of one, but it tries to do the same thing as quote, but better
13:25:12PMunchSo I landed on just calling it superQuote
13:25:18*Cthalupa quit (Ping timeout: 260 seconds)
13:25:27YardanicopoorMansQuote
13:25:42dadadaPMunch: have you thoroughly tested that superQuote works in all use cases that quote does, because then I'll simply replace all my quote does with it now ...
13:25:57PMunchWhile you're here: https://github.com/nim-lang/Nim/pull/14258 Am I missing something here? Or should this check move to further along in the process so that sfImportc is parsed?
13:25:57disbotAllow let to not have value when using importc
13:26:02dadadaI'd even consider to just somehow overload quote do with it
13:26:18Yardanicolol
13:26:46PMunchdadada, it's mostly untested, but it generates a "quote do" statement in the end IIRC. So with single identifiers it should be pretty much the exact same thing
13:26:55*Romanson joined #nim
13:27:02*Cthalupa joined #nim
13:28:01PMunchBasically what it does is lift stuff like `r.ho` out of the quote. So it makes it into "let tmp123123 = r.ho; quote do: `tmp123123`"
13:28:11dadadaPMunch: "mostly untested" "IIRC" "should be" "pretty much" ... this is not the most reassuring wording!!!
13:28:25*ftsf quit (Ping timeout: 246 seconds)
13:29:04PMunchdadada, haha it'll be fiiine
13:29:33PMunchBut seriously, the design of it is sound, so it should work well
13:29:39dadadaPMunch: well it makes sense why it doesn't work with quote do, how would quote do know about the identifier of the temp
13:29:40Yardanicohttps://static01.nyt.com/images/2016/08/05/us/05onfire1_xp/05onfire1_xp-superJumbo-v2.jpg
13:30:17PMunchWow, that is one high-res meme Yardanico
13:30:26Yardanicoit's from new york times lol
13:30:44dadadanot the identifier, I mean the temp is probably not accessible, or whatever, I've really no clue, I'm just sad that original quote do
13:30:51dadadahas no support for such stuff yet
13:30:57Yardanicodadada: the original quote do doesn't work because it doesn't understand expressions at all
13:31:03Yardanicothe "temp" stuff is inserted by superQuote
13:31:08Yardanicoit's not there at all with normal quote
13:31:16PMunchdadada, that's why I created superQuote, so people don't have to be sad :)
13:31:16YardanicoI mean expressions like ra.ho
13:31:47dadadaYardanico: yes, I know... I'm probably just ranting because this issue has cost me hours
13:32:10PMunchNo idea why your mixing doesn't work though
13:32:12PMunchI think it should..
13:32:14*abm quit (Read error: Connection reset by peer)
13:32:50PMunchOh, apart from that it was using `r.ho` in the normal quote do..
13:33:12dadadaPMunch: oh, you're right!
13:33:13PMunchThat's probably why it fails
13:33:49dadadaPMunch: yep, I get sloppy when I'm frustrated
13:33:59PMunchWho doesn't?
13:34:14PMunchBut yeah, just use superQuote and be happy :)
13:34:56dadadawrite some test cases, and then lobby Araq to make it the default quote do
13:35:48dadadapretty please
13:36:18dadadaI love convenience
13:36:34Yardanicodadada: well only if it's 100% backwards compatible :P
13:36:58PMunchIt should be
13:36:58dadadaYardanico: that's why I recommend the test cases... there must be some for the old quote do, so superQuote should be tested with those
13:37:08PMunchWell, not 100%, it doesn't support the same bugs
13:37:14Yardanicoohno
13:37:31PMunchIt does do some slightly sketchy stuff though..
13:38:19PMunchLike it uses parseStmt (or parseExpr, can't remember) https://nim-lang.org/docs/macros.html#parseStmt%2Cstring
13:38:45PMunchBut that's just because the NimNodeKind for `` is a bit odd
13:39:06dadadadude, you're the worst seller of your own code ever, "mostly untested" "IIRC" "should be" "pretty much" "it does do some slightly sketchy stuff though.."
13:39:24PMunch"makes you happy"
13:39:36PMunchI'm just trying to manage expectations here :P
13:40:11PMunchIf I told you it was awesome 100% test-coverage, Covid free, solves world hunger
13:40:24PMunchImagine how let down you would be if it didn't work
13:40:41*opal quit (Quit: No Ping reply in 180 seconds.)
13:40:45PMunchNow you can only be positively surprised by how well it works
13:41:02*opal joined #nim
13:42:03PMunchmacroutils (and all the other packages) should be available in the playground again
13:42:13PMunchNot quite sure why they weren't
13:42:51Araqdadada, should be in fusion :P
13:43:13dadadawhat's fusion?
13:44:18Yardanico!repo fusion
13:44:19disbothttps://github.com/nim-lang/fusion -- 9fusion: 11Fusion is for now an idea about how to grow Nim's ecosystem without the pain points of more traditional approaches. Time will tell if the idea is a good one. 15 37⭐ 2🍴 7& 1 more...
13:46:28disruptekoh shit araq is back
13:46:33Yardanicoyep
13:46:39Yardanicoyou better stream IC dev today :D
13:46:52dadadawe have the worst sales people here "Time will tell if the idea is a good one" ... imagine apple going ... so the iPhone is an idea how to create a communication device without the pain points of traditional approaches. Time will tell if the idea is a good one. We think the device should work as expected if we can recall correctly. It does some sketchy things though. We don't want you to get any high
13:46:55*PMunch quit (Ping timeout: 260 seconds)
13:46:56disruptekyeah, i have to fix my blocker bug.
13:46:57dadadaexpectations. 2000$
13:47:18Yardanicodadada: open source software development != commerical marketing
13:47:32Yardanicopeople in open source are *usually* more honest
13:48:11dadadaYardanico: thanks captain obvious, I'm using humour which is using hyperbole to get across that we shouldn't undersell ourselved, overselling is not good either
13:48:12disrupteksoftware development is all about managing expectation.
13:48:26Yardanicodadada: sorry I didn't see it as humour :P
13:49:19dadadanp :P
13:50:49Araqdadada, well the idea of a mono-repo to reduce the testing overhead from A*B*C*D*... down to 2*2 so that stuff actually works is controversial
13:51:33Araq;-)
13:56:25*liblq-dev quit (Ping timeout: 246 seconds)
13:58:37*liblq-dev joined #nim
14:02:23*zacharycarter joined #nim
14:28:41FromDiscord<Prodigle> I'm struggling to divide 2 int64's
14:28:41FromDiscord<Prodigle> proc CalculatePrimes(number: var int64):seq[int64] =
14:28:41FromDiscord<Prodigle> var start = cpuTime()
14:28:42FromDiscord<Prodigle> var primeNumbers: seq[int64]
14:28:42FromDiscord<Prodigle> for i in 2..number:
14:28:42FromDiscord<Prodigle> while number mod i == 0:
14:28:44FromDiscord<Prodigle> primeNumbers.add(i)
14:28:45FromDiscord<Prodigle> number = number/i
14:28:47FromDiscord<Prodigle> individual.writeLine( (cpuTime()-start)* 1000)
14:28:48FromDiscord<Prodigle> echo("Completed")
14:28:50FromDiscord<Prodigle> return primeNumbers
14:29:03FromDiscord<Generic> use div for integer division
14:30:04*exelotl quit (Ping timeout: 272 seconds)
14:30:39Araqand don't use 'var T' parameters if you don't understand Nim's mutability rules
14:31:05narimiranand don't go above `sqrt(number)` ;)
14:31:32FromDiscord<Prodigle> What do you mean by the var T param?
14:31:38Yardanico"number: var int64"
14:31:48FromDiscord<Prodigle> Var makes it mutable no?
14:32:08Yardanicoyou can just do "var number = number" inside of the proc to make a mutable copy for your own proc
14:32:19FromDiscord<Generic> var on parameters means you can pass in a variable to be modified by that proc
14:32:22Yardanicoand with current definition you should always declare your numbers with "var" so they can be used with CalculatePrimes
14:32:32Yardanicoand the original number will get modified
14:32:58FromDiscord<Prodigle> That's fine 🙂
14:34:19*leorize quit (Remote host closed the connection)
14:35:08*leorize joined #nim
14:35:45narimiranand what exactly does your proc really do?
14:36:19narimiranput 24 as "number" and suddenly 4 is a prime, if i'm executing this in my head correctly
14:37:38narimiranno, wait :D
14:37:40FromDiscord<Prodigle> Nah it comes up with 2 and 3
14:37:43FromDiscord<Prodigle> but 2 is repeated
14:37:46FromDiscord<Prodigle> so I need to look at that
14:38:19FromDiscord<Prodigle> It's basically just dummy code for some timings
14:39:42*ptdel joined #nim
14:40:08FromDiscord<Prodigle> I do have an issue that a ported version of this code in C# is taking under a second to calculate for 24265915380 but is still going in Nim
14:40:34Yardanicoshow the C# code (please use a paste service)
14:40:45Yardanicoand did you compile with -d:release or -d:danger ?
14:40:51FromDiscord<Prodigle> with release
14:41:24FromDiscord<Prodigle> https://pastebin.com/N4Wx2f0z
14:41:51FromDiscord<Prodigle> func at the bottom
14:42:39narimiranput nim version on https://play.nim-lang.org/
14:43:05FromDiscord<Prodigle> https://play.nim-lang.org/#ix=2lEk
14:43:36FromDiscord<Prodigle> ah
14:43:37FromDiscord<Prodigle> runs fine
14:44:20Yardanicoalso you might want to use std/monotimes for benchmarking instead
14:44:23FromDiscord<Prodigle> Anything wrong with my flags? nim c --run .\main.nim --threads:on -d:release --opt:speed
14:44:45Yardanicocompletes instantly for me here
14:44:48YardanicoI mean your code with -d:release
14:44:50leorizelooks fine to me
14:45:11leorizethough that code should be refactored to use result
14:46:02leorizelooks like the C# version even use parallel computations
14:46:15leorizethough it'd actually make things slower for this use case afaict
14:47:39FromDiscord<Prodigle> I think so yeah, I'll bump up the numbers when they're both working
14:47:49*nsf quit (Quit: WeeChat 2.8)
14:47:49FromDiscord<Prodigle> Still looking at a post 40 second run on my PC
14:47:58FromDiscord<Prodigle> even with all the timing code and streams taken out
14:48:11Yardanicoit literally completes in a second for me
14:48:12leorize[m]you should keep the timing code
14:48:14YardanicoI mean less
14:48:27leorize[m]binaries generated by gcc usually got caught in windows defender
14:48:29Yardanicotakes 4ms for me
14:48:32Yardanicolol
14:48:45YardanicoI mean it takes 2ms but total binary time is 4ms
14:48:49leorize[m]most of your time will be spent waiting for the binary to actually be executed :P
14:49:14FromDiscord<Prodigle> Running constant at about 10% cpu usage
14:49:23Yardanicotry to disable antivirus software really
14:50:12FromDiscord<Prodigle> Real time protection is off hmm
14:52:17FromDiscord<Prodigle> Other nim programs work fine still
14:52:24FromDiscord<Prodigle> Can't even think what's wrong here
14:52:32Yardanicome neither
14:52:35Yardanicomaybe your C compiler is broken :P
14:52:36FromGitter<kaushalmodi> Araq: Can I source one config.nims in another?
14:52:38Yardanicotry to recompile it
14:52:44YardanicoI mean the nim file
14:52:46leorizeI'll try to tweak your nim version a bit
14:52:51Yardaniconim c -f -d:release file.nim
14:53:05Yardanico--opt:speed is superfluous here btw
14:53:11Yardanicosince -d:release already implies it
14:53:26FromDiscord<Prodigle> Gotcha
14:53:30FromDiscord<Prodigle> recompiled with no difference
14:53:41*deepend_ is now known as deepend
14:54:18Yardanicowell I really think it's not the Nim who's at fault there :P
14:54:25Yardanicomaybe OS is doing some weird stuff, idk
14:54:43FromDiscord<Prodigle> Yeah
14:54:46Yardanicohttps://play.nim-lang.org/#ix=2lEo
14:55:05Yardanicoit runs on playground with quite fast speed considering playground doesn't compile in release mode
14:55:13*deepend quit (Quit: o/)
14:55:32FromDiscord<Prodigle> Task Manager showing 9.5-10% cpu usage and 0.4MB memory
14:55:37*deepend joined #nim
14:55:37FromDiscord<Prodigle> nothing super out of the ordinary
14:59:42disruptek~stream
14:59:42disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
14:59:52disruptekcompiler shit.
14:59:53Yardanico^ go join mumble bois
15:01:11shashlickdisruptek: just tagged nimterop last night
15:01:17disrupteknice.
15:01:49*abm joined #nim
15:02:50shashlickhttps://github.com/nimterop/nimterop/blob/master/CHANGES.md
15:04:25Araqhttp://www.pathsensitive.com/2019/07/the-best-refactoring-youve-never-heard.html
15:08:55*Vladar joined #nim
15:09:09FromDiscord<Prodigle> So it finally finished at 6 minutes...
15:09:11FromDiscord<Prodigle> hmm
15:09:20*Cthalupa quit (Ping timeout: 272 seconds)
15:10:23alexander92guys
15:10:25*Cthalupa joined #nim
15:10:26alexander92so what is the pattern
15:10:29alexander92to return early from async
15:10:48leorize`return` doesn't work?
15:11:24alexander92no!
15:11:27alexander92the problem is that
15:11:41leorizeuse disruptek's technique then: wrap your proc body in a named block, then `break namedBlock`
15:11:45alexander92`async` seems to require producing a `complete(retFuture..)`
15:11:49alexander92etc before return
15:11:54alexander92so when i produce a return
15:11:56alexander92from a macro
15:12:02alexander92it just returns nil without completing
15:12:11alexander92and this leads to an assertion error
15:12:36FromDiscord<Prodigle> Do you have a code example?
15:12:41alexander92hm, interesting
15:12:45alexander92this might work, thanks
15:13:02alexander92other option is to expose an `earlyReturn` template from async
15:13:15alexander92which does the completion correctly
15:13:23alexander92this seems to maybe work for my case
15:13:30alexander92but the break thing sounds smart
15:13:50alexander92ugh but .. this requires changing all the async functions i use..
15:13:57alexander92the macro in
15:14:32*sz0 joined #nim
15:15:20alexander92another option is to expose the internal future as some kind of special variable
15:15:39alexander92e.g. nimAsyncdispatchRetFuture
15:16:33alexander92the best would be to somehow redefine return itself as a template similar to await
15:22:26*sentreen_ quit (Quit: sentreen_)
15:23:46*sentreen joined #nim
15:24:00*sentreen quit (Client Quit)
15:24:08*sentreen joined #nim
15:34:07*sentreen quit (Read error: Connection timed out)
15:34:26*sentreen joined #nim
15:34:34FromGitter<sheerluck> Until Araq linked that talk about "Best Refactoring" it never occurred to me that most of you are haskell programmers as well.
15:34:41Yardanicolol?
15:36:29narimiranmost of us?
15:40:53Yardanicoalmost none of us
15:43:38FromGitter<sheerluck> narimiran oh you are an OCaml programmer, I see
15:44:07narimiranhaha, i did some stuff in ocaml, but calling myself "ocaml programmer" might be a stretch :)
15:47:11leorize[m]Yardanico, @Prodigle: here's the translation of the C# code into Nim, this one don't do parallel though: https://play.nim-lang.org/#ix=2lEJ
15:47:20leorize[m]also Yardanico, the code crashes on ARC
15:47:24Yardanicothanks
15:48:16FromDiscord<mratsim> @sheerluck, Haskell with while loop?
15:48:45leorize[m]this is the new bridge, right? pings should reach the other side, yes?
15:48:48Yardanicono
15:48:51Yardanicothis is old bridge still
15:49:06Yardanicobecause discord stopped sending full member list to my bot and I need to implement it myself now :)
15:49:14Yardanicoalso KrispPurg needs to do some crash fixes for the ib
15:49:31leorizemaybe someone could ping Prodigle for me :P
15:49:39leorizesee if that code runs faster or slower than C#
15:49:45leorizeI won't bet on it being fast though :P
15:49:48FromDiscord<Yardanico> @Prodigle
15:50:00FromDiscord<Prodigle> Yup
15:50:32FromDiscord<Prodigle> ?
15:50:38FromDiscord<Prodigle> Oh
15:51:14leorizethe only optimization that can be done left here is to move calculatePrimes out of main()
15:51:23leorizethis makes calculatePrimes stop being a closure
15:51:36leorizeI kept it in because it's the closest to the C# version
15:51:42Yardanicoleorize: it crashes because of cursor
15:51:47Yardanicoremoving it makes it work with arc
15:51:55leorizeoh lol I forgot I put that in
15:52:11leorizewonder why it crashes though
15:52:58FromDiscord<Prodigle> Invalid pragma cursor
15:53:05Yardanicoold nim?
15:53:08Yardanicowhich one you're on?
15:53:13Yardaniconim -v
15:53:21FromDiscord<Prodigle> Potentially, haven't updated in a couple months
15:53:24FromDiscord<Prodigle> nim -v
15:53:41FromDiscord<Prodigle> 1.0.6
15:53:51leorizethe latest is 1.2
15:53:55FromDiscord<Prodigle> XD
15:53:56leorizebut that version isn't too old
15:54:03leorizeyou can remove the cursor pragma
15:54:25leorizeI didn't test if it's any faster/slower with/without it
15:54:30FromDiscord<Prodigle> Runs like expected at least
15:54:35FromDiscord<Prodigle> couple seconds
15:54:39leorizeit's an optimization for --gc:arc only
15:54:55FromGitter<kaushalmodi> narimiran: Should be have a Releases landing page on nim-lang.org?
15:54:58FromDiscord<Prodigle> Thanks 🙂 No idea what the problem was beforehand
15:55:08FromGitter<kaushalmodi> Right now, one needs to know to go to https://nim-lang.org/blog.html to see release notes
15:55:11disruptek!rfc 177
15:55:13disbothttps://github.com/nim-lang/RFCs/issues/177 -- 3Unify Nim's GC/memory management options
15:55:30narimiranwhat would be the content of that page?
15:55:32FromGitter<kaushalmodi> Instead it would be nice to have a separate https://nim-lang.org/releases.html or https://nim-lang.org/new.html just for releases and special announcements
15:55:35leorizeProdigle: different code I guess :P
15:55:46FromGitter<kaushalmodi> narimiran: Release notes of course
15:56:00FromDiscord<Prodigle> Thanks again 🙂
15:56:17FromGitter<kaushalmodi> If a newcomer visits the nim-lang page, they are more likely to click on "Releases" than "Blog"
15:56:26FromGitter<kaushalmodi> they would want to know "What's New"
15:56:44leorizecalling it "What's New" sounds better than "Releases" :P
15:57:01FromGitter<kaushalmodi> sure
15:57:09FromGitter<kaushalmodi> but we need a separate landing page :)
15:57:32FromGitter<kaushalmodi> "Blog" sounds a bit "non-serious" for a topic of weight like release notes
15:57:32leorizeI think we need an actual designer to help us with this :P
15:58:21leorize> Support for various backends: it compiles to C, C++ or JavaScript so that Nim can be used for all backend and frontend needs.
15:58:26leorizeI think we should remove this line
15:58:43leorizethe "compiles to C, C++" triggers people for whatever the reason
15:58:43Yardanicobecause some people think compiling to C is not cool? :D
15:59:40leorizepeople thought that "compiles to C" == "is C"
15:59:55Yardanicolol
16:00:06leorizeadvertise it as really good interop with C and C++ sounds better
16:00:06Yardanicobut they see examples on the right
16:00:13Yardanicothey don't look like C for me
16:00:27leorizepeople don't care, the C-word triggers them
16:00:45leorizeeven D's author got into the trap saying that "D don't compile to C because of C limitations"
16:00:58Yardanicowhat limitations
16:01:07leorizedon't ask me, ask him :P
16:01:18leorizeI saw that on HN one day and he never replied to any comments
16:01:36Araqleorize, the real question is how to write docs for people who refuse to read
16:02:33Araqand also, if we really want to consider these people our target audience
16:03:29leorizeI also saw honest questions about "if Nim compiles to C, then that mean I gotta take the C and compile it to get the binary?"
16:03:32leorizeon reddit iirc
16:03:50Yardanicobut C compiles to asm so I gotta take the asm and compile it to binary?
16:04:03leorizedoes any C compiler advertise that?
16:06:02shashlickAgree, website should talk about interop but not backends
16:06:24shashlickThat's already documented in backend.html and only for interested parties
16:09:13leorizeand the "compiles to C" part kinda lures people into thinking that Nim generates the kind of C code you'd write
16:10:25shashlickFact though is that opinions keep everyone away from all sorts of things
16:10:44Araqjust like GCC produces human-readable asm code, I guess
16:11:51leorizealso our landing page is too big
16:12:03shashlickOh gc, oh whitespace, oh generics, whatever
16:12:06leorizeI need to scroll a full page on my laptop to get to the "Install" button
16:12:09alexander92Araq the "everyone should read the whole manual and remember 15 gotchas" is a very small niche to fill
16:12:33shashlickI think it is fair to keep the website crisp and high level
16:12:47shashlickSince most people don't read, me included
16:13:01alexander92i just dont understand if any humans operate like this: trying and guessing is just how humans act imho
16:13:27leorizecomparing our landing page to: https://www.rust-lang.org/, https://crystal-lang.org/, https://www.python.org/
16:13:33leorizeours is a bit bloated
16:14:28leorizethe first big "click me" button you see on the others are "Get Started", "Install", "Try", "Download"
16:14:39leorizewe have, uh, a menu bar and a lot of text
16:15:32Araqleorize, I agree
16:15:42Araqwe already trimmed it down a bit
16:15:57leorizeI think we need a restructural of the landing page
16:16:03leorizethe layout just doesn't work
16:16:51leorizewe have plenty of places to steal ideas from :p
16:17:32Araqalexander92, I don't see an alternative. If you cannot comprehend X, what makes us think you can comprehend Y instead.
16:18:08Araqthere is a limit to how moronic you can become and still get away with it
16:18:19alexander92i don't think this is relevant
16:19:05alexander92no one wants to read a n-thousand word technical document and remember all the edge cases / idioms mentioned in it
16:19:06FromDiscord<mratsim> there was this language which had a drop down that showcased mini-programs in that language
16:19:22alexander92before actually start playing with it
16:19:27shashlickif you crash by raising an exception, does the quitProc still get called
16:19:32FromDiscord<mratsim> https://github.com/nim-lang/website/issues/168
16:19:32disbotSliders to display more examples
16:19:35leorizemratsim: go have something like that
16:19:41leorizehttps://golang.org/
16:20:03leorizeI personally think that our current layout doesn't work
16:20:06*Senketsu quit (Quit: WeeChat 2.8)
16:20:09alexander92i just think people naturally often read just enough to do what they want to
16:20:11FromDiscord<mratsim> see inko: https://inko-lang.org/
16:20:17FromDiscord<mratsim> I'm OK with the layout
16:20:25alexander92so inevitably they get surprised from time to time
16:20:35Araqso what
16:20:38alexander92but i am talking about non-surprising api-s/errors
16:20:45leorizemratsim: I can't even find the "Install" button without scrolling a page :P
16:20:46alexander92maybe we're just talking about different things :D :D :D
16:20:59leorizethat's the difference between our layout and others
16:21:03Araqalexander92, you're talking about how designed Nim before v1
16:21:26Araqthere is always some rule and it's always surprising for some, so let's have more rules
16:22:07Araqsee also how C++ got its symbol resolution rules in templates
16:22:38Araqthis way of designing things doesn't work, ymmv
16:22:45alexander92no, rules and specs are great, my point was only that one can have both: great docs and api-s/errors/hints trying to prevent silly user misuages
16:22:54alexander92misusages*
16:23:08alexander92of course, one can only go some distance, but both are possible to some extent
16:23:36leorizedo we have anyone on staff to take care of the design? it's not urgent but it'd be nice if we get a cleaner landing page before 1.4 is out
16:23:39alexander92after all, the less possible way there are for one to butcher some kind of construct/api, the better
16:23:48Araqleorize, yes, narimiran
16:25:24narimiranok, but can we be more precise what is "better", "cleaner", etc.?
16:26:03*dddddd joined #nim
16:26:05leorizeview the site in 1366 x 768 resolution, then look at other langs pages
16:26:16leorizeyou'll find the difference really fast :P
16:27:32leorizewait, the first part of our page doesn't even fit on a FHD screen...
16:27:53FromDiscord<clyybber> I don't get it
16:28:22narimiranok, what should be removed?
16:28:32leorizenot removed per-se, but moved
16:28:51leorizeis it really necessary that we bombards everyone with info when they first arrive?
16:29:04*Vladar quit (Quit: Leaving)
16:29:26leorizegive them a quick overview, some buttons that take them to resources to install Nim and/or to try Nim
16:29:33FromDiscord<clyybber> is it really neccessary we use 1366 x 768 to display 3 words :p ?
16:29:42leorizeexpand on the language in the following section
16:30:00leorizethat's pretty much how every other languages do
16:30:19leorizeclyybber: well that screen res is still the most popular
16:30:28leorize(I for one, still own a laptop with that res :P)
16:31:04FromDiscord<clyybber> yeah, and I find its pretty fine
16:31:07narimiran"Gentlemen, a short view back to the past. Two years ago, our users told us: ....... Less content, more? Or less and more comunication with your websites."
16:31:09FromDiscord<clyybber> better than rusts tbh
16:31:13Yardanicoleorize: most popular where? :P
16:31:20narimiran(now, lets see if anybody recognizes this reference)
16:31:22Yardanicodid you do a survey for software developers?
16:31:25Yardaniconarimiran: I do :D
16:31:39FromDiscord<clyybber> leorize: Most often people with those screens *complain* that it looks like a mobile site
16:31:43FromDiscord<clyybber> not the other way around :D
16:31:48shashlick@zacharycarter - still looking for that cimgui wrapper?
16:32:04narimiranYardanico: the best interview question ever!! :)
16:32:10zacharycartershashlick: mmm not really looking I am using nimterop
16:32:15zacharycarterto produce one
16:32:18FromDiscord<clyybber> I guess we could move the three mantras to the top
16:32:27FromDiscord<clyybber> but other than that I think its best to stay as is
16:32:34leorizeYardanico: according to web design analytics, not sure which one, since I heard it from a friend studying graphic design
16:32:40zacharycarterI was just commenting on nimterop skipping types due to type aliases appearing before type definitions
16:32:47leorizeI trust designers more than programmers trying to design things :P
16:32:51narimiranwe don't want users with poor screens :P :D
16:33:07shashlick@zacharycarter - ast2 is now released and you don't need to do all that
16:33:11shashlickforward declarations work
16:33:20Yardanicoi don't really understand people who judge a language by the webpage
16:33:34FromDiscord<clyybber> leorize: But its not designers reading our webpage but programmers
16:33:46FromDiscord<clyybber> And programmers usually value having actual information on the screen
16:33:50*exelotl joined #nim
16:34:03leorizeyou can say that but almost everything you use has gone through a designer hands
16:34:03zacharycartershashlick: cool! I'll try upgrading
16:34:39shashlickhere's the command - `toast -pnr -E_ -F_ -f:ast2 -DCIMGUI_DEFINE_ENUMS_AND_STRUCTS cimgui.h`
16:34:49shashlickonly thing you need to set is `type Bool = bool`
16:34:55shashlickbut i'm planning on fixing that as well
16:34:59leorizewell we have google analytics on Nim's front page, right?
16:35:04leorizehow long do people spend there?
16:35:23Yardanicowe do?
16:35:23leorizehow much do they scroll? etc
16:35:31leorizeyes, yes we do
16:35:35Yardanicoah yeah I see ublock origin blocking GA
16:35:37Yardanico:P
16:36:17leorizewhen was the last time we even look at those analytics lol
16:37:00FromDiscord<clyybber> can you simply say what you think is wrong with the site?
16:37:08leorizeI already did lol
16:37:15Yardanicohow it looks on smaller screens?
16:37:20leorizetoo much text, little to no interactivity
16:37:33Yardanicowell we may want to add links to playground for code examples
16:37:38Yardanicoso users can change the code I guess
16:37:47Yardanicoand run it
16:38:13leorizehttp://0x0.st/i_6r.png
16:38:18leorize^ if you wanna see what I see
16:38:23Yardanicothat looks fine for me
16:38:28Yardanicoreally
16:38:37Yardanicothere's just enough info
16:38:37leorizeignore the borders :P it's a firefox setting
16:38:49Yardanicoyeah I can do the same in chrome to see 1366x768
16:39:07*liblq-dev quit (Ping timeout: 260 seconds)
16:39:34Yardanicoso IMO that stuff is all subjective
16:39:44FromGitter<Knaque> This might be a stupid question, but (hopefully I'm explaining this well) is it possible for a module to import another into the global scope?
16:39:47Yardanicoit might look bad for you but not for some other people
16:39:57Yardanico@Knaque you mean to import another module and export it?
16:39:59narimiranleorize: so we should put "install" and "learn nim" buttons at the top, before the "efficient" heading?
16:40:07leorizeI'm just constrasting it with every other pages: http://0x0.st/i_6s.png, http://0x0.st/i_6z.png
16:40:11FromGitter<Knaque> Yep, that sounds right.
16:40:22Yardanicoimport module <newline> export module
16:40:48*liblq-dev joined #nim
16:40:50Yardanicohttps://nim-lang.org/docs/manual.html#modules-export-statement
16:40:56FromDiscord<clyybber> ok, so install button to the top, learn nim, try nim to the top
16:41:01FromDiscord<clyybber> and the three mantras to the top
16:41:06FromGitter<Knaque> Much thanks!
16:41:17FromDiscord<clyybber> leorize: Do you agree?
16:41:49leorizesounds like improvement
16:41:55leorizeit'd be nice to have a preview
16:42:11narimiranok, i'll try it, you'll have a PR and a screenshot tomorrow
16:42:35narimiranor maybe even now :)
16:42:42leorizeyou should run through some of the comments on the forum about the landing page too
16:42:50narimiranlink?
16:43:08*dadada quit (Ping timeout: 256 seconds)
16:43:32leorizeI don't have it here :P
16:43:36Yardanicohttps://forum.nim-lang.org/t/6319
16:44:06*dadada joined #nim
16:44:29*dadada is now known as Guest28990
16:45:45leorizenarimiran: do you have access to our analytics as well?
16:45:49narimirannope
16:45:58leorizeping dom96 I guess
16:47:05leorizepersonally I think this sentence should be reworded: "Support for various backends: it compiles to C, C++ or JavaScript so that Nim can be used for all backend and frontend needs."
16:47:54leorizesomething along the lines of "generating fast native binaries or JS for all backend and frontend needs"
16:48:30leorizethe backend thing is meaningless to anyone without experience
16:49:06*solitudesf quit (Remote host closed the connection)
16:49:33*solitudesf joined #nim
16:51:43narimiranleorize: better? https://i.imgur.com/0BoVn6Z.jpg
16:52:01leorizenarimiran: when you're done, please open an article on the forum asking for feedback too :) we should have the community at large reflect on the website and not just me :P
16:52:26narimiran100 people, 100 opinions
16:52:28leorizethe flow looks weird though :/
16:52:44*krux02 joined #nim
16:52:55leorizenote points that matters
16:53:16leorizeusually there will be something that's in common that will stick out in all feedbacks
16:54:07narimiranhttps://imgur.com/pHZvcQe ?
16:54:27Yardanicohmm that doesn't look bad
16:55:04leorizewe can make the efficent points and the examples their own section, right?
16:55:13leorizeit's right below a small heading so people won't miss it
16:55:32leorizeyou can invert the bg color if you want the code snippets to have dark bg
16:55:58leorizeeg. the heading light bg, next section dark bg
16:56:16narimirani can even put the version number there
16:56:30narimiranso people can immediately tell what is the latest stable version
16:56:41leorizeyea that sounds good
16:56:56leorizea small "release notes" link there would be nice too
16:57:12leorizealso can we finally have the playground linked on the front page?
16:57:26leorizemost new users don't even realise we have a playground lol
16:57:28narimiranhttps://imgur.com/KCd9Hzu
16:57:36narimiranoh yeah, playground should have a link there too
16:57:53Yardanicoand if we can do that implement so that users can play with the code from examples in playground
16:57:57Yardanicowe can just have predefined links or something
16:58:02narimiranyep
16:59:00leorizenarimiran: maybe the version should be in a caption right below
16:59:03leorizelike how rust do it
16:59:26leorizecrystal also do it like that too
17:08:46*chapl joined #nim
17:09:08chaplI did join the IRC
17:09:09chaplyay
17:10:33Yardanicochapl: yay
17:10:42chaplirssi ftw
17:10:48chapl*triggered*
17:11:20chaplsurprised that irssi's able to run on windows
17:12:52Yardanicochapl: btw fyi we have #nim-offtopic :P
17:13:13FromGitter<bung87> https://github.com/bung87/ts2nim it can transpile its self now
17:13:31*chapl left #nim (#nim)
17:13:34Araqbung87: can you now please move the html stuff to fusion
17:13:48shashlickAraq: had a question on code reordering
17:14:00*titanomachy joined #nim
17:14:10*Cthalupa quit (Ping timeout: 246 seconds)
17:14:11shashlickit doesn't work on code that is generated via macro or parseString
17:14:19FromGitter<bung87> do I need rename the relatived lib name ?
17:14:22shashlickit doesn't work if the code is included either
17:14:41shashlickonly if you have an import module, it works within that module
17:14:46FromGitter<bung87> as it same as std lib name, I just using relative import avoiding conflicts
17:14:46Araqshashlick, well it's 'experimental' for a reason, maybe we can fix it though
17:14:50shashlickis this as expected?
17:16:16*Cthalupa joined #nim
17:16:55Araqbung87: you will be able to import it as 'import fusion / htmlparser'
17:16:58*leorize[m] uploaded an image: Screenshot_2020-05-11 Nim Programming Language.png (168KB) < https://kde.modular.im/_matrix/media/r0/download/asra.gr/IQOQExXjGnjztqMuBetmnxnf >
17:17:09leorize[m]narimiran: ^ did a small mockup
17:17:11shashlickI opened this a couple days ago as well on codeReordering interaction with pragmas - https://github.com/nim-lang/Nim/issues/14290
17:17:29FromGitter<bung87> @Araq so I just need move all file under src/htmlparser?
17:17:56FromGitter<bung87> src/fusion/htmlparser
17:19:54FromGitter<bung87> ok I get it just follow nimble structure
17:20:31narimiranleorize[m]: i'll try to do something like that
17:23:41*trui quit (Quit: WeeChat 2.3)
17:24:03*chapl joined #nim
17:24:29*chapl quit (Remote host closed the connection)
17:25:07*chapl joined #nim
17:25:30chaplaccidentally pressed ctrl+c, oof
17:26:41*chapl quit (Client Quit)
17:27:03*opal quit (Ping timeout: 240 seconds)
17:27:55Araqleorize[m], fusion now has code in it and tests, please do your CI magic
17:28:22FromGitter<bung87> @Araq done.
17:28:45Araqwow thanks
17:28:49Araqthat was fast
17:29:06*nsf joined #nim
17:29:12FromGitter<bung87> :)
17:30:41*opal joined #nim
17:31:36FromGitter<kaushalmodi> Araq: Dumb question.. shouldn't each fusion package live in its own subdir?
17:31:53FromGitter<kaushalmodi> that way that subdir could have it's own tests dir, etc
17:33:39FromGitter<bung87> using one config is well, as the lib will test every gc
17:34:27FromDiscord<kraptor> Hi, don't know if this has been already reported, but I ran into differente behavior depending on how I declare the same (sematically the same) object type https://play.nim-lang.org/#ix=2lFh
17:34:50FromDiscord<kraptor> I was expecing to get everything "true"... but for some reason I get different behavior for TEST_OBJECT_ref2 :/
17:36:33FromDiscord<kraptor> tried to find something similar in reported bugs, but my search-fu seems broken today
17:38:18FromDiscord<kraptor> ohhh... my fault, had to declare the later as "TEST_OBJECT_ref2 {.union.} = ref object {.union.}"
17:38:38Yardanicothat's a bug then
17:38:46Yardanicobecause you'll then get " Warning: type pragmas follow the type name; this form of writing pragmas is deprecated [Deprecated]Э
17:39:36FromDiscord<kraptor> interesting, defining it as "TEST_OBJECT_ref2 = ref object {.union.}" works too...
17:42:35leorize[m]narimiran: more concept art: https://0x0.st/i_6I.png
17:42:43Yardanicoi don't like white :P
17:42:44leorizedon't ask for the code though, I did all this in inspector tool
17:43:15leorizeit's just for the really small heading :P
17:43:28Yardanicowell i don't really like it that way
17:43:31YardanicoI mean the color
17:43:50leorizeah yea, I just randomly picked the colors :P
17:44:48leorizeit's a concept to describe the kind of flow I got in my head
17:44:57leorizeI'll let narimiran decide how to design it
17:45:45narimiranthat will end well.... :P :D
17:48:10leorize[m]I also have this kind of flow too: https://0x0.st/i_6G.png
17:48:21leorize[m]but then I decided that I like the previous one better
17:48:55leorizeplease do look around and don't use these verbatim :P
17:49:33FromGitter<bung87> narimiran spell like japanese
17:49:46Yardanicowdym?
17:50:41FromGitter<bung87> it can represent japanese prounce
17:50:56*hoijui joined #nim
17:51:43*couven92 joined #nim
17:51:46narimiranhuh?
17:52:32FromGitter<bung87> I am on bed now cant type japanese on my mobile show it
17:55:32*fredrikhr quit (Ping timeout: 260 seconds)
17:55:43FromDiscord<codic> How can i generate a random alphanumeric string?
17:55:47FromDiscord<codic> of size 16
17:55:56narimiranjust smash your keyboard
17:56:03narimiranand then take first 16 characters
17:56:07FromGitter<bung87> hhhhh
17:56:11leorize[m]lol
17:56:24FromDiscord<codic> no no no
17:56:26FromDiscord<codic> I mean with nim
17:56:28FromDiscord<codic> xd
17:56:44Yardanicoit's easy
17:56:46Yardanicouse sample
17:57:10leorizedoes it take a set[T]?
17:57:14Yardanicoyep
17:57:18leorizeniceee
17:57:25Yardanicohttps://nim-lang.org/docs/random.html#sample%2Cset%5BT%5D
17:57:47FromDiscord<codic> yeah ik but how do I get a string of all letters and numbers? manually
17:57:48FromDiscord<codic> yeah ik but how do I get a string of all letters and numbers? manually?
17:58:11Yardanico!eval import random; for x in 0..16: stdout.write sample(Letters + Digits)
17:58:15NimBotCompile failed: /usercode/in.nim(1, 52) Error: undeclared identifier: 'Letters'
17:58:23Yardanico!eval import random; import strutils; for x in 0..16: stdout.write sample(Letters + Digits)
17:58:27NimBotdSvvoO6pIOYKII0fi
17:58:28Yardanicosee
17:58:35Yardanicohttps://nim-lang.org/docs/strutils.html#Letters
17:58:36FromDiscord<codic> thanks
17:59:26FromGitter<bung87> strong memory yardanico
17:59:33Yardanico?
17:59:51*Guest28990 quit (Ping timeout: 260 seconds)
18:00:19leorize[m]I guess they meant that you have good memory
18:00:26Yardanicoyeah I understood that :P
18:00:37FromDiscord<codic> And how do I append to a file?
18:00:43Yardanicofile.write
18:00:45FromDiscord<codic> Is there an appendFile?
18:00:45FromDiscord<codic> Oh
18:00:49Yardanicostdout is just a file handle
18:00:59leorize[m]remember to open the file with fmAppend
18:01:05FromDiscord<codic> alright
18:01:50*Cthalupa quit (Ping timeout: 256 seconds)
18:02:02*chapl joined #nim
18:03:16FromDiscord<kraptor> @Yardanico i filled an bug and tried to explain as best as I could, thanks
18:03:21*Cthalupa joined #nim
18:04:01FromDiscord<codic> So I got https://hatebin.com/flqsoqmnqn
18:04:22FromDiscord<codic> now see what my problem is is that after first run, it doesn't append anything on second run.
18:04:35Yardanicoalso do f.flushFile()
18:05:23leorizeremember to close the file
18:05:27Yardanicohe does defer
18:05:53leorizeclose will flush the file
18:06:14narimiran0..16 --> you have off by one if you want 16 characters ;)
18:06:46*dadada joined #nim
18:07:09*dadada is now known as Guest85945
18:07:44FromDiscord<codic> true
18:07:53FromDiscord<codic> wait so why doesn't it append anything?
18:08:22narimiranput `var y:string` outside of for loop
18:09:13narimiranmaybe.
18:10:08FromDiscord<codic> but it should generate a new one every time
18:10:16narimiranbtw, why not a simple `y.add(sample(....))`?
18:10:34FromGitter<kaushalmodi> !eval import random; import strutils; var str: string; for i in 0 .. 15: str.add(sample(Letters + Digits)); echo str
18:10:38NimBotd↵dS↵dSv↵dSvv↵dSvvo↵dSvvoO↵dSvvoO6↵dSvvoO6p↵dSvvoO6pI↵dSvvoO6pIO↵dSvvoO6pIOY↵dSvvoO6pIOYK↵dSvvoO6pIOYKI↵dSvvoO6pIOYKII↵dSvvoO6pIOYKII0↵dSvvoO6pIOYKII0f
18:10:55narimiranyeah, i misunderstood what you wanted, sorry
18:11:14FromGitter<kaushalmodi> hmm, how do I make that echo fall outside that for loop in that oneliner?
18:11:23narimiranparentheses
18:11:32FromGitter<kaushalmodi> cool
18:11:48*narimiran quit (Quit: leaving)
18:15:08*Senketsu joined #nim
18:20:50*Romanson quit (Quit: Connection closed for inactivity)
18:21:15*chapl quit (Changing host)
18:21:15*chapl joined #nim
18:24:34FromDiscord<Technisha Circuit> Is there any other nim interpreters/repls besides the one nim has by default?
18:26:38Yardanicoinim
18:26:42Yardanicobut it's a fake REPL imo :P
18:26:45FromDiscord<codic> So I got to https://hatebin.com/vmnsupkvwq. but now i get a file like
18:26:45FromDiscord<codic> ```
18:26:45FromDiscord<codic> d
18:26:45FromDiscord<codic> S
18:26:46FromDiscord<codic> v
18:26:46FromDiscord<codic> v
18:26:46FromDiscord<codic> o
18:26:46FromDiscord<codic> O
18:26:48FromDiscord<codic> 6
18:26:49FromDiscord<codic> p
18:26:50Yardanicodon't paste like that
18:26:50FromDiscord<codic> I
18:26:51FromDiscord<codic> O
18:26:53FromDiscord<codic> Y
18:26:53Yardanicoplease
18:26:54FromDiscord<codic> K
18:26:55FromDiscord<codic> I
18:26:56FromDiscord<codic> I
18:26:58FromDiscord<codic> 0
18:26:59FromDiscord<codic> f
18:27:00FromDiscord<codic> i
18:27:01FromDiscord<codic> ```
18:27:03FromDiscord<codic> oh yeah sorr
18:27:04FromDiscord<codic> y
18:27:12chapl:D
18:27:13FromDiscord<codic> https://hatebin.com/fbmtatnrfy
18:27:18chaplhatebin?xD
18:27:27chaplwtf
18:27:43FromDiscord<codic> ¯\_(ツ)_/¯
18:28:02FromDiscord<arnetheduck> `nlvm` has a branch that implements jit execution with `llvm` - turning that into a repl would be easy
18:28:16FromDiscord<Technisha Circuit> Thanks
18:28:59FromDiscord<codic> So I don't get why it just pastes 16 characters - ALWAYS the same - into the file. any ideas?
18:29:07Yardanicorandomize()
18:29:22Yardanicoyou need to randomize the seed for the random number generator
18:29:35Yardanicohttps://nim-lang.org/docs/random.html#basic-usage
18:29:49FromDiscord<codic> ah.
18:29:51Yardanicohttps://play.nim-lang.org/#ix=2lFG
18:29:55Yardanicoa bit more nice looking code :P
18:30:21FromDiscord<codic> is anyone predicting my purpose here?
18:30:27Yardanicoyeah I already did
18:30:29FromDiscord<codic> lol
18:30:32Yardanicobut the chance is really low
18:30:36FromDiscord<codic> thanks worked!
18:30:38FromDiscord<codic> true
18:30:54leorizedon't use the random module if you want true random though
18:31:06Yardanicoleorize: for his purpose it's fine
18:31:18FromDiscord<codic> yeah
18:33:53FromGitter<sheerluck> question to Araq: can the knowledge from "The Best Refactoring You've Never Heard Of" be applied to Nim in a way that we can banish "defer: f.close()" from Nim? What is the most Nim-ish place to call "f.close()" in Nim-without-defer?
18:34:52leorizeuse destructors and you'll never have to care about close()
18:36:23FromGitter<sheerluck> so https://nim-lang.org/docs/destructors.html
18:36:45leorizeonce things stablize we will adapt the stdlib to embrace it
18:36:48*hoijui quit (Quit: Leaving)
18:37:39FromGitter<sheerluck> that is great.
18:37:54Yardanicothat document is mostly for internal usage btw
18:37:59Yardanicoit's not an "end-user guide" yet ;)
18:44:01chaplWhat's wrong with defer-ing?
18:51:17FromDiscord<Technisha Circuit> How would i do `not in` in Nim?
18:51:31FromDiscord<Technisha Circuit> Because that isn't valid apparently
18:51:40solitudesfnotin
18:53:11FromDiscord<Technisha Circuit> Oh thanks :P
18:53:55FromDiscord<Technisha Circuit> I'm also doing the same thing as @codic :P
18:54:06FromDiscord<Technisha Circuit> I wonder if there is a way to verify the link :/
18:54:10FromDiscord<Yardanico> Also you can have not_in if you really want :D
18:54:16FromDiscord<Technisha Circuit> O
18:54:18FromDiscord<Yardanico> Or nOtIn
18:54:18FromDiscord<Technisha Circuit> Coolio
18:54:22FromDiscord<Technisha Circuit> Why?
18:54:28FromDiscord<Yardanico> or nOTIN
18:54:30FromDiscord<Technisha Circuit> nOtIn is just why?
18:54:33FromDiscord<Technisha Circuit> Oh god
18:54:35FromDiscord<Yardanico> Because you can
18:54:38FromDiscord<Technisha Circuit> Case insensitive nim
18:54:52FromDiscord<Yardanico> Partially
18:55:35FromDiscord<codic> if thing notIn thing ftw
18:56:11FromDiscord<codic> ```nim
18:56:11FromDiscord<codic> template `not in`(x,y:string)= x notin y
18:56:11FromDiscord<codic> ```
18:56:22FromDiscord<codic> or better
18:56:34FromDiscord<codic> ```nim
18:56:34FromDiscord<codic> template [T]`not in`(x,y:T)= x notin y
18:56:34FromDiscord<codic> ```
18:56:36alexander92does this work?
18:56:39alexander92:)
18:56:54alexander92if it did nim would be able to parse a lot of random stuff imo
18:57:16alexander92keep in mind the ident operators syntax is limited
18:57:26alexander92you can use all kinds of `@` `!` etc iirc
18:57:32alexander92but not all kinds of idents
18:57:34FromDiscord<codic> lemme see
18:58:02alexander92the problem is that it clashes with `not` and `in` maybe
18:58:15FromDiscord<Yardanico> Yeah
18:58:17FromDiscord<codic> o
18:58:43FromDiscord<codic> Oof type mismatch
18:58:49FromDiscord<codic> but i used generics :9
18:58:55FromDiscord<codic> probs because the clash
18:59:40FromGitter<sheerluck> chapl https://play.nim-lang.org/#ix=2lFM
19:01:09FromDiscord<codic> does nimpy support decorators for using a python library in nim?
19:01:13FromDiscord<codic> if so are they just pragmas?
19:01:34PrestigeIs there a way to change the order of objects in an OrderedSet?
19:01:40FromDiscord<Yardanico> Aren't they just Python functions
19:01:45PrestigeI'm attempting to swap two elements in particular
19:01:54FromDiscord<Yardanico> So you can call them explicitly?
19:02:45FromDiscord<codic> they are technically
19:02:48FromDiscord<codic> So yeah
19:03:08FromDiscord<Yardanico> So call a decorator with the function itself as an argument
19:03:48FromDiscord<Yardanico> And if you mean wrap a Nim proc in a Python decorator - do that in Python side
19:05:43FromDiscord<codic> I actually do mean that, i'm trying to use the flask module
19:05:44FromDiscord<codic> In nim
19:05:56FromDiscord<codic> i know jester exists
19:06:22FromDiscord<Yardanico> Uhhh
19:06:29FromDiscord<Yardanico> I don't think that's the way to go
19:06:33FromDiscord<codic> Neither do I
19:07:01FromDiscord<codic> ¯\_(ツ)_/¯
19:08:18alexander92noooope
19:08:26alexander92this is not a good idea
19:08:40alexander92you neither get to use normal idiomatic nim, nor speed or etc
19:08:58alexander92you can try to use jester, it is a sinatra-like small framework
19:09:03alexander92so it should be similar in scope to flask
19:09:29alexander92decorators can be immitated, but often ruby-like block api-s
19:09:32alexander92seem better in nim imho
19:09:42FromDiscord<codic> ruby blocks ftw
19:09:43alexander92its subjective
19:09:55alexander92yeah, you can easily do similar things with templates here
19:09:59*tane joined #nim
19:10:22FromDiscord<Technisha Circuit> @codic I'm letting the link gen run for a while now
19:10:35FromDiscord<codic> Nice
19:10:46alexander92disruptek https://news.ycombinator.com/item?id=23144444
19:11:03FromDiscord<Technisha Circuit> I need a way to verify the links ;-;
19:11:26alexander92i already agree with you that discarding itself shouldn't be forbidden, but i just want to show another example that some way of linting stuff like this *is* useful
19:11:50alexander92maybe when we have nim linter this can be in
19:13:28FromDiscord<Yardanico> @Technisha Circuit do it then
19:13:37FromDiscord<Yardanico> check how Discord itself verifies it via http requests
19:13:40FromDiscord<Yardanico> and replicate that
19:13:43FromDiscord<Technisha Circuit> I have no idea how though
19:13:45FromDiscord<Technisha Circuit> Oh
19:13:52FromDiscord<Technisha Circuit> Good idea but I'm on mobile rn ;-;
19:15:02FromDiscord<Yardanico> https://discord.com/api/v6/entitlements/gift-codes/tbV99DlLxSEqDews?with_application=true&with_subscription_plan=true
19:15:47FromDiscord<Technisha Circuit> Oh thanks
19:15:58FromDiscord<Technisha Circuit> :P
19:16:49FromDiscord<Technisha Circuit> What data do I need to send to it and what would a valid gift return?
19:17:59Yardanicocheck yourself
19:18:16FromDiscord<Technisha Circuit> Okay, thanks :P
19:18:33FromDiscord<codic> how do I get json data from a get request?
19:18:43Yardanicoyou mean parse?
19:18:45YardanicoparseJson
19:18:47FromDiscord<Technisha Circuit> In python it's `response.text`
19:18:48Yardanicofrom json module
19:18:50FromDiscord<codic> ah thank you
19:18:54YardanicogetContent returns text
19:18:57FromDiscord<Technisha Circuit> :P
19:18:58Yardanicoget returns a Response
19:19:31Yardanicoalso good luck getting banned by discord or cloudflare
19:19:38FromDiscord<KrispPurg> is there a way to do getOrDefault for tables that the default value is an Option, or a similar?
19:19:43FromDiscord<KrispPurg> lol
19:19:51Yardanico@KrispPurg it just works, no?
19:20:03FromDiscord<codic> boom https://hatebin.com/kyikdoyvtq
19:20:05*D_ quit (Ping timeout: 240 seconds)
19:20:19Yardanico@codic parsing here is overhead
19:20:30YardanicoI reallly don't see why would you parse that simple json every time :P
19:21:02*D_ joined #nim
19:21:07FromDiscord<codic> Nvm, wrong url
19:21:07FromDiscord<codic> Yeah I could check for `Unknown Gift Code` in the string
19:21:08FromDiscord<codic> Doing that
19:21:57FromDiscord<codic> https://hatebin.com/gjgpiftcnb
19:21:57FromDiscord<Yardanico> @KrispPurg https://play.nim-lang.org/#ix=2lFS
19:21:58FromDiscord<KrispPurg> On json module, there is https://nim-lang.org/docs/tables.html#getOrDefault%2CTable%5BA%2CB%5D%2CA%2CB and there is no support for returning default specific types.
19:22:05FromDiscord<codic> I'm not going to be running this though
19:22:31FromDiscord<Yardanico> also @KrispPurg can you push your fixes to devel? my bot crashes a lot
19:22:39FromDiscord<KrispPurg> okay
19:22:50*Zunaka joined #nim
19:23:03FromDiscord<Yardanico> all in gateway.nim(670) handleDispatchIter
19:23:13FromDiscord<KrispPurg> guild member updates?
19:23:17Yardanicoyep
19:23:17ZunakaHey, what's the discord link?
19:23:23*Guest85945 is now known as dadada
19:23:29Yardanicohttps://discord.gg/ezDFDw2
19:23:37ZunakaThanks!
19:23:52*dadada is now known as Guest22369
19:23:59FromDiscord<KrispPurg> hold on
19:24:36Guest22369let's say I've a big module where I want to unit test certain sub-procs in order to ensure that they work correctly, but I don't want to export them because they're internal funcs/procs, but that also means they're not available in a unittest module because you can't import them... what to do there?
19:24:48YardanicoGuest22369: use inclued
19:24:50Yardanicoinclude*
19:24:53*Guest22369 is now known as dadada
19:25:04Yardanicowhen isMainModule: include mytests
19:25:11Yardanicoand write tests which test that stuff in mytests
19:26:41FromDiscord<KrispPurg> Yardanico it's pushed now
19:26:51Yardanicothanks
19:26:58*couven92 is now known as fredrikhr
19:27:28FromDiscord<KrispPurg> the demon error has escaped.
19:27:28FromDiscord<KrispPurg> https://youtube.com/watch?v=SSW2yFieV3c&t=6m2s
19:29:31FromDiscord<KrispPurg> anyways, I can do that, but I mean like default that is different to the value type.
19:29:41Yardanicoyou can only have 1 type
19:29:50Yardanicobecause a variable can only have 1 type
19:30:01Yardanicoyou can't just say "ok we can decide at runtime which type this variable will be"
19:30:09Yardanicouse object variants if you want that :P
19:30:14FromDiscord<KrispPurg> rip
19:31:04PrestigeI remember there was a shorthand way to get an element from the end of an array but can't recall the syntax. Anyone know what it is?
19:31:09Yardanico^1
19:31:13Yardanicoarr[^1]
19:31:27*Vladar joined #nim
19:31:28Prestigethanks
19:33:56*liblq-dev quit (Quit: WeeChat 2.8)
19:37:20FromDiscord<Yardanico> @KrispPurg btw please use https://github.com/nitely/nim-regex instead of "re" so your lib will not depend on any libraries 🙂
19:37:48FromDiscord<Yardanico> you only seem to use it in 1 place but even then it'll require pcre.so (or pcre.dll on Windows)
19:38:42FromDiscord<Yardanico> i mean it won't depend on any native libraries
19:39:21FromDiscord<KrispPurg> mkay
19:39:25*nsf quit (Quit: WeeChat 2.8)
19:39:34*Jesin quit (Quit: Leaving)
19:40:32FromDiscord<KrispPurg> I wouldn't have to change anything, but the module?
19:40:46FromDiscord<Yardanico> well you'll have to probably, but it's not hard,
19:41:02FromDiscord<Yardanico> nim-regex is mostly compatible with PCRE syntax except backreferences and backtracking
19:41:06FromDiscord<KrispPurg> im asking cuz im feelin a bit lazy rn
19:42:07FromDiscord<codic> what's wrong with the inbuilt nre https://nim-lang.org/docs/nre.html tho
19:42:12FromDiscord<codic> or re https://nim-lang.org/docs/re.html
19:43:09FromDiscord<Yardanico> The fact that you'll also need pcre native module
19:43:17FromDiscord<Yardanico> Since they both use it
19:43:21FromDiscord<codic> ah, i see
19:43:25*Jesin joined #nim
19:43:29FromDiscord<codic> then using nim-regex seems better
19:43:45FromDiscord<codic> or for pattern matching pegs
19:45:01FromDiscord<Yardanico> npeg yeah
19:45:22FromDiscord<Yardanico> They both will probably end up in Fusion anyway
19:45:28*titanomachy quit (Ping timeout: 272 seconds)
19:45:33FromDiscord<Yardanico> I mean npeg and nim-regex
19:46:35FromDiscord<codic> o
19:47:03FromDiscord<Yardanico> !repo Fusion
19:47:10FromDiscord<codic> !repo fusion
19:47:14FromDiscord<codic> welp
19:47:23FromDiscord<Yardanico> Ah right disbot is turned off
19:47:39FromDiscord<Yardanico> https://github.com/nim-lang/fusion
19:48:06leorize[m]Araq: are we gonna use testament on fusion or just plain ol' `nimble test`?
19:51:11leorizealso what version of the compiler are we going to test against?
19:51:29leorizeI can do multiple versions if needed
19:55:51*ptdel quit (Remote host closed the connection)
19:57:17FromDiscord<exelotl> is there a way I can run `fmt` on a string that was pulled in via `staticRead`?
19:58:00*filcuc joined #nim
19:58:18FromDiscord<exelotl> I'm trying this but getting an error: 'staticRead' can only be used in compile-time context https://pastebin.com/raw/YJqDX91V
19:58:21*chapl left #nim (#nim)
19:59:31alexander92and oii
19:59:38alexander92are you making a template engine
19:59:46alexander92great stuff
20:00:18FromDiscord<exelotl> Yeah trying to make a super simple 3 line template engine lol
20:00:26alexander92yeah i did that with karax
20:00:27alexander92iirc
20:01:00alexander92i returned karax tree-s written in file as result of procs
20:01:05FromDiscord<exelotl> I've tried several variations e.g. using a helper template to put the staticRead into a const before sending it to the macro, but I still get the same error :|
20:01:30alexander92it should be possible imo
20:01:42alexander92noo
20:01:43alexander92i get it
20:01:49alexander92you cant newLit with that
20:01:57PrestigeAny docs on inline procs? Like, similar to a ternary
20:02:00alexander92newLit would need a literal string man
20:02:56alexander92try with `newStrLitNode`
20:02:59leorizePrestige: inline procs?
20:03:10FromDiscord<exelotl> Oh, I'll try that after dinner
20:03:15alexander92or if not, generate a call to `view2(staticRead(str))`
20:03:17Prestigeessentially a ternary statement (even though we don't have those in nim)
20:03:20Prestigeleorize: ^
20:03:21alexander92and then in view2 you can do
20:03:25alexander92:)
20:03:50leorizePrestige: we do have ternary statements, just not super short
20:03:54leorize:P
20:04:25Prestigee.g. let a = proc(): int = if true: 1 else 2
20:04:40leorizeyou nailed the syntax
20:04:47Prestigewell damn okay
20:04:55PrestigeI couldn't find it documented anywhere lol
20:05:09FromDiscord<Yardanico> If expressions
20:05:16leorizeit's too intuitive :P
20:05:22*solitudesf- joined #nim
20:05:39FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#statements-and-expressions-if-expression
20:05:56FromDiscord<Yardanico> You just have to understand the difference between statements and expressions :)
20:05:57PrestigeThanks @Yardanico
20:06:36*konvertex quit (Quit: quit)
20:07:25*arecaceae quit (Remote host closed the connection)
20:07:36FromDiscord<exelotl> This is the thing I always found hard about learning nim: you have to know what the thing is called before you can find the docs for it
20:07:58FromDiscord<exelotl> Once you cross that threshold it gets a lot easier
20:08:11FromDiscord<exelotl> And the situation isn't as bad as it used to be
20:08:16*solitudesf quit (Ping timeout: 272 seconds)
20:08:18*arecaceae joined #nim
20:08:34FromDiscord<Yardanico> Well how would you solve it?
20:09:18FromDiscord<exelotl> I wish I had a good answer x)
20:10:31leorizefind out how most people call certain features then add reference to them to the manual
20:10:42leorizemakes it easy for them to do a text search :p
20:11:12*konvertex joined #nim
20:21:15stefantalpalaruHave you ever seen tables not being garbage collected? It starts to look like that here, where an array of 2 tables keeps replacing its members with new tables, but the GC heap doesn't go down: https://github.com/status-im/nim-beacon-chain/pull/1007
20:22:41FromDiscord<clyybber> stefantalpalaru: Does it occur with markandsweep or boehm too?
20:23:42*Senketsu quit (Ping timeout: 260 seconds)
20:25:13Prestigeleorize: How would I go about doing that? I'd like to add "ternary" to the "If expression" section
20:26:07stefantalpalaruI can't use Boehm (or even the default GC switched to malloc: https://gist.github.com/stefantalpalaru/79105fb6e7e724733cacb14fd94d4b1c) due to a weird attempt to deallocate in the middle of an allocated region: https://gist.github.com/stefantalpalaru/5515af7eea62499aaa1f2de1af075c3c
20:26:18leorizePrestige: you gotta pull off some clever sentences :P
20:27:21skrylar[m]hoi
20:27:41PrestigeI must find the nim website/manual and submit a pr
20:27:59leorizePrestige: usually "This feature is similar to ternary operators in other languages" works
20:28:05leorizethe manual is in nim-lang/Nim
20:28:07leorizedocs/manual.rst
20:28:11Prestigenice, thanks
20:29:41FromDiscord<exelotl> Yeah that's good
20:32:53*zagani joined #nim
20:37:10*zagani left #nim (#nim)
20:39:37nikita`I'm reading notes and code I did for system integration ~3 years ago. different PM, but if nim itself gets installed to $prefix/nim/ and nimble installs packages to $prefix/nimble/pkgs/ is that canonical? I can't find any consensus about the location for distributors or I forgot to document it
20:42:18leorizeit's in docs/packaging.md
20:42:43*NimBot joined #nim
20:45:52nikita`ok, that's for nim itself. but nim packages, as in sources I can define a generalized build procedure for and use nimble to handle it.. do they expect a standard location for themselves, did the nim community agree on a location, or ...?
20:46:11*zagani joined #nim
20:46:12leorizeunfortunately, no
20:46:25leorizenimble doesn't even support a system-installation location for packages
20:47:06nikita`okay. I just hook on to nimble, it works for what I define.
20:47:15nikita`ie like
20:47:17nikita`ERROR: /usr/work/devel/nim-nake/work/.destdir/usr/pkg/nim/pkgs/bin/nake
20:47:30nikita`nvm the error, that's pkgsrc plist generation
20:47:59*solitudesf- quit (Remote host closed the connection)
20:48:26FromGitter<sheerluck> Oh Nikita You will never know anything about my home. I'll never know how good it feels to hold you
20:50:34nikita`leorize: okay, creeps I can't filter out aside, since it seems no one has done this since I last had this conversation 3 years ago, maybe it's just up to experimenting.
20:50:58leorizewell you have me to ask
20:51:00leorizealso federico3
20:51:13leorizewe are the only packagers for nim afaik
20:51:19leorizealso stefantalpalaru iirc
20:52:14nikita`I'm working on adding support for it to pkgsrc. I have some 3/4th finished, never upstreamed material for Guix which I am building on as comparison
20:52:15leorizenikita`: currently the compiler supports multiple nimble dir
20:52:20federico3FWIW see https://nim-lang.github.io/Nim/packaging.html
20:52:23leorizebut funny enough nimble doesn't support this
20:52:59leorizehttps://github.com/nim-lang/nimble/issues/80
20:53:08nikita`federico3: okay, this is about nake and other applications, not nim itself :)
20:53:25nikita`thanks
20:53:39leorizecurrently there's no consensus, purely because nimble doesn't support this
20:53:57leorizefor my packages I put them in /usr/share/nimble
20:54:10leorizebut nimble can't use this dir so deps resolution will never take it into account
20:54:15leorizemaking it completely useless
20:54:57nikita`hm
20:56:29federico3nikita`: I feel your pain, packaging is the biggest pain point of the language
20:56:56*Vladar quit (Quit: Leaving)
20:58:00nikita`i think i'll read into the ticket and get back to you within the next weeks.
20:58:21FromGitter<kaushalmodi> leorize: you can symlink the ~/.nimble to wherever you have the pkgs installed?
20:58:45leorizewe are doing packaging
20:58:59leorizethe point here is to make it work seemlessly with the user
20:59:18leorizeie. the user should be able to `nimble install` and have their own nimble directory
20:59:21nikita`and not introduce sideeffects
20:59:24FromGitter<kaushalmodi> For nimble pkgs deployed at work, I have a Nim alias with --nimblePath (or something like that)
21:00:03FromDiscord<Technisha Circuit> Is there an OS that uses Nim mainly if not completely?
21:00:09leorizenope
21:00:18FromDiscord<Technisha Circuit> Aw
21:00:25FromDiscord<Technisha Circuit> Ik there's one is Golang
21:00:29federico3huh?
21:00:33FromDiscord<Technisha Circuit> But it's sad that Nim doesn't have one
21:00:42federico3good
21:00:42FromDiscord<Technisha Circuit> An OS written in Nim
21:00:47leorizekaushalmodi: yea but the integrating with the system is different
21:00:52FromDiscord<Technisha Circuit> Why good?
21:01:25federico3you mean a kernel or the userspace tooling or "everything"?
21:01:36FromDiscord<Technisha Circuit> Everything
21:01:50FromDiscord<Technisha Circuit> Any would be fine tho
21:02:40FromDiscord<Technisha Circuit> https://github.com/dom96/nimkernel is a kernel written in Nim
21:03:30federico3that's a toy kernel
21:03:51FromDiscord<Technisha Circuit> Wdym?
21:08:01*filcuc quit (Ping timeout: 264 seconds)
21:08:06shashlickcan cligen read flags from a file?
21:10:22FromGitter<deech> I don't seem to be able to use a custom `task build, "": ...` to work with `nimble build`. That task and any `before build:...` hook is ignored. Is this a new change?
21:10:49leorizesounds like a bug to me
21:11:56dadadakrux02: I'm beginning to understand you more, compiler bugs are destroying my workflow now
21:12:55dadadaError: internal error: getTypeDescAux(tyProxy)Error: internal error: getTypeDescAux(tyProxy)#
21:13:10dadadait works if I include the type, or copy+paste the code into the module
21:13:21dadadabut if I import it, the upper error appears ...
21:14:56dadadaat that point you lose faith in Nim
21:14:58xacewhat would be the easiest way to run a exectuable in the background ? I just want to have the program launched, i dont care about the output or errorcode, in c i would system("myprogram &> /dev/null");
21:15:17leorizestartProcess()
21:15:18dadadabut I don't want to... it's just wtf, this is such a simple thing, it should never fail
21:15:45dadadaxace: (program) &
21:15:48dadadarun it in a subshell
21:16:00leorizedon't abuse the shell please
21:16:03leorizeit's not portable
21:16:25leorizedadada: do you have a bug report and/or sample code?
21:16:37dadadaleorize: yeah, I'm making sample code now
21:18:09xaceleorize: the problem with startprocess is that i have to close the process afterwards...
21:19:17leorizeyou can just not do that :P
21:19:28xaceso it wont mess things up?
21:19:44leorizeother than leaking a bit of memory? yea
21:20:14xacewell my nim program will not live longer than 1 second... or are you referring to the os level?
21:20:29leorizenah, just your nim program
21:22:01leorizexace: also see poDaemon
21:22:31leorizeso {poDaemon, poParentStreams}
21:22:38leorizethen the leakage will be none
21:22:54dadadaleorize: https://play.nim-lang.org/#ix=2lGO
21:23:14dadadait works on playground, because you need to put the sample ref into a separate module and import for the error to be triggered
21:23:40dadadaoops, I commented the import out, you need to reverse that of course
21:23:44xaceleorize: well now i have to look up the manual to understand that... :( i just want a simple run_executable() also i want to silence the program....
21:23:44*titanomachy joined #nim
21:24:18leorizethen you'll have to wait until I'm done with my process library :P
21:24:43leorizedadada: this bug looks familiar
21:25:11leorizetry renaming the sample module into something that's not sample
21:25:18xacelol been tempted to write it myself for the past year, but something always comes up
21:25:41dadadaleorize: the name was originally sampleTree ... ? seriously a bug based on the name of the module??!
21:25:47dadadaand that also didn't work
21:26:20leorizeit works for me
21:26:34leorizeI just renamed sample.nim into samplet.nim
21:26:46leorizethis bug is due to faulty symbol binding
21:26:58dadadaand why didn't it work when my module was named sampletree.nim ?
21:27:02FromDiscord<exelotl> alexander92: ah my problem was unrelated, my `view` macro was fine but I was also using `staticRead` somewhere else that wasn't allowed
21:27:07xacegeez, does startprocess() need the full path to the executable?
21:27:19leorizedadada: remember how `import module` let you do `module.thisProc`?
21:27:28skrylar[m]dadada: yep those can happen. if a module is named foo and has a type Foo it will also explode
21:27:40leorizeyea, this is the case where the `module` symbol was binded instead of the type...
21:27:44leorizeI thought we fixed this
21:27:47leorizexace: poUsePath
21:28:01skrylar[m]leorize: not in 1.2.0 :b
21:28:05dadadathat's soo stupid!, oh man, sorry, that's just disappointing
21:28:23leorizedadada: make your types have the first letter uppercase
21:28:35leorizeskrylar[m]: I thought we got this out before 1.0 even lol
21:29:35dadadaleorize: yep, the fix works
21:29:49dadadastill, this is a showstopper bug... how can nim be this stupid
21:29:51PrestigeNot seeing anything in the manual about this - is there a built-in proc to get the index of an item in an array/seq?
21:30:05PrestigeI've just been using my own proc `indexOf`
21:30:19dadadaleorize: thanks!
21:31:02leorizePrestige: `find`
21:33:01*titanomachy quit (Quit: Titano quit.)
21:33:24leorizedadada: can you file an issue?
21:33:27*abm quit (Read error: Connection reset by peer)
21:33:30PrestigeThanks
21:33:35dadadaleorize: yes, I'll file
21:33:52*abm joined #nim
21:33:54leorizeI thought we already tackled this, but now I can't find the exact issue anymore :/
21:34:44xacediscard startProcess(&"simple_program '{file}' &> /dev/null", options = {poDaemon, poEvalCommand, poUsePath}) # geez, will the stdlib ever add a easier function? run_disown or something?
21:35:12leorizelol if you use poEvalCommand, use execCmdEx
21:35:21leorizeit does exactly what you want
21:35:30leorizeI just don't want you to have to touch the shell
21:35:36leorizebut that'd have to wait I guess
21:36:37xaceleorize: yeah, but execcmdex requires me to wait for the prcess to finish
21:37:38dadadaleorize: https://github.com/nim-lang/Nim/issues/14310 is this issue written good enough?=
21:37:43leorizexace: ah, true
21:37:54xacealso poevalcommand waas neccessary to silence the stdout, stderr. because then i have to use poinherintparentstreams and that would be another annoyance
21:38:36xaceyou have to wait until the program spawns until your nim program closes... so much work for something so simple :(
21:38:50leorizeput poParentStreams in too
21:39:08leorizeor else nim will allocates two 3 pipes for the child process
21:39:48xacethe line just got longer
21:39:59alexander92exelotl <3 ok
21:40:05dadadaleorize: written well enough?
21:40:59leorizeusually you should use the issue template...
21:41:15FromDiscord<exelotl> 1 line templating engine for jester :D
21:41:18FromDiscord<exelotl> macro view(str: static[string]): string = newCall("fmt", newLit(staticRead(str)))
21:45:54FromDiscord<Technisha Circuit> What's a good websocket library for Nim?
21:46:03FromDiscord<Technisha Circuit> And how would i get a python-like class system?
21:46:08FromDiscord<Technisha Circuit> With an init function
21:46:15FromDiscord<Technisha Circuit> Because man i can't leave Python
21:46:31leorizethen you shouldn't use Nim :)
21:46:54*exelotl quit (Ping timeout: 240 seconds)
21:46:58leorizeseriously, if you wanna use Nim to the fullest, you gotta embrace all of it
21:47:10FromDiscord<Technisha Circuit> True ;-;
21:47:21leorizebecause Nim just looks like python, it's not python in any other way
21:47:27FromDiscord<Technisha Circuit> But how would i make a class system then?
21:47:32FromDiscord<Technisha Circuit> ;-;
21:47:37leorizeyou don't
21:47:59*tane quit (Quit: Leaving)
21:48:00leorizeI mean you can but I'd advise strongly against it
21:48:18FromGitter<kaushalmodi> I can speak for myself: I got into Nim because it had most of the things I needed, and then for the stuff it didn't, I was able to relatively easily contribute to it (compared to other languages)
21:48:33leorizealso for a websockets library the only one around is `websockets` <- that's a nimble package
21:48:49FromGitter<kaushalmodi> Technisha Circuit: You need to start with a fresh approach on how Nim is designed to work
21:48:59FromDiscord<exelotl> is there a particular feature you want or is it just the "look and feel" of having a constructor and fields and stuff under 1 roof?
21:49:02FromGitter<kaushalmodi> you will be miserable if you try to make it work like Python
21:49:27FromDiscord<Technisha Circuit> Thanks and okay ;-;
21:50:51leorizeTechnisha Circuit: you can refer to @KingDarBoja
21:51:03leorizeoh wait I can't ping discord here
21:52:19leorizewe actually have a lot of former python users here
21:52:51leorizeand to make you feel better, most of them tried to make nim work like python the first two weeks writing nim :P
21:54:05FromDiscord<Never Listen To Beef> It's the same thing for any programmer from a different language, they want the old and then they realize the new is cooler 😄
21:55:09krux02dadada: If you care about it. I am working on my own compiler fork by now. But I didn't get into fixing a single bug yet. All I did so far was refactoring and throwing out experimental features.
21:55:29krux02and merging my old unmerged pull requests.
21:55:36FromDiscord<Technisha Circuit> Oof
21:55:57FromDiscord<Never Listen To Beef> I mean my first bit of time in nim i was attempting to do OOP and C# things
21:56:29FromDiscord<Technisha Circuit> Hahaha
21:57:05FromDiscord<Technisha Circuit> Well, if i wanted to make a discord lib, and I'm unable to use classes, how would it be structured?
21:57:19FromDiscord<Technisha Circuit> Keep in mind I'm planning on making the lib usable in Python too
21:57:48FromDiscord<Never Listen To Beef> What do you mean how would it be structured?
21:58:39FromDiscord<Technisha Circuit> How would it just work generally without classes?
21:59:01FromDiscord<Never Listen To Beef> Using events, and Value type objects
21:59:04FromDiscord<Technisha Circuit> In classes i am able to use `self` or `this` as it's more commonly known as
21:59:16FromDiscord<Technisha Circuit> Could you tell me how those work? 😅
21:59:23FromGitter<kaushalmodi> Technisha Circuit: You probably don't yet know of proc overloading in Nim
21:59:41FromGitter<kaushalmodi> I'd recommend going through https://narimiran.github.io/nim-basics/
21:59:55leorizealso learn object variants
22:00:01FromGitter<kaushalmodi> also https://nim-lang.org/learn.html
22:00:18leorizeusually variants can replace most class systems
22:00:27FromGitter<kaushalmodi> > Keep in mind I'm planning on making the lib usable in Python too ⏎ ⏎ You just compile the Nim project to a .so/.dll and load that in Python
22:00:43FromDiscord<Technisha Circuit> Thanks!
22:02:01FromGitter<kaushalmodi> Technisha Circuit: Someone in my Mastodon feed posted this regarding Nim .so loading in Python: https://mastodon.in.th/@sirn/104110103788846643
22:03:32FromDiscord<Never Listen To Beef> Am i just dumb, i've only ever seen operator overloading, what is proc overloading?
22:05:17leorizeproc overloading means that you can have a procedure of the same name that takes different parameters
22:05:32FromDiscord<Never Listen To Beef> Ah ok so i did know of it just didnt expect it in that context
22:06:15FromDiscord<Never Listen To Beef> I guess it's also called overloading in C# but i rarely do it
22:06:16FromDiscord<Never Listen To Beef> Im dumb
22:06:50dadadaare people that worked on the vscode extension in this channel?
22:09:17*Cthalupa quit (Ping timeout: 260 seconds)
22:09:31FromGitter<kaushalmodi> Never Listen To Beef: I think I learned of the "function overloading" term from my C++ classes in undergrad.. never touched C++ after that
22:10:51FromDiscord<Never Listen To Beef> Yea "method overloading" in C#, but in this case i think i just shut the murmurs of my C# brain since most of that knowledge is useless in nim 😛
22:11:18*Cthalupa joined #nim
22:11:29leorizesome programming concepts are pretty universal
22:12:55FromDiscord<Never Listen To Beef> Apparently so
22:13:12*abm quit (Quit: Leaving)
22:17:14*Cthalupa quit (Ping timeout: 240 seconds)
22:17:20*lmariscal quit (Quit: I'm Out!)
22:17:43*lmariscal joined #nim
22:17:53*Cthalupa joined #nim
22:27:44FromDiscord<Doongjohn> https://play.nim-lang.org/#ix=1ZTy is this a bug? this code is from the doc
22:31:14*thomasross joined #nim
22:31:44leorizenot sure
22:33:13*zacharycarter quit (Ping timeout: 264 seconds)
22:34:15*Zunaka quit (Quit: Some folks are wise, and some otherwise.)
22:54:17*chemist69 quit (Ping timeout: 244 seconds)
22:54:35*Trustable quit (Remote host closed the connection)
22:55:15*chemist69 joined #nim
23:00:17*zacharycarter joined #nim
23:11:44FromDiscord<KingDarBoja> leorize: did you pinged me? I saw the conversation with Technisha Circuit
23:11:45FromDiscord<KingDarBoja> 😄
23:11:55FromDiscord<KingDarBoja> @Technisha Circuit sup bro
23:13:07*lritter quit (Quit: Leaving)
23:13:50*disbot quit (Ping timeout: 272 seconds)
23:14:14*disruptek quit (Ping timeout: 260 seconds)
23:18:23*disbot joined #nim
23:18:43*disruptek joined #nim
23:21:00FromGitter<kaushalmodi> I somehow think that Technisha is a sis
23:22:46FromDiscord<KingDarBoja> Doesn't matter to me
23:34:43zacharycarterstream is up https://www.twitch.tv/zachary_carter
23:42:22zacharycartershashlick: looks like nimterop is generating `Bool`?
23:44:51zacharycarternevermind looks like it was fixed in a new version
23:48:10zacharycarteralso I don't think the ast change fixed my issue and nimterop seems way slower now
23:48:26*krux02 quit (Remote host closed the connection)
23:49:49zacharycartermy issue being that nimterop still doesn't handle type aliases correctly
23:49:54zacharycarterand I still have to cOverride them
23:54:25*voltist quit (Quit: Ping timeout (120 seconds))
23:54:43*voltist joined #nim
23:56:02FromGitter<timotheecour> @kaushalmodi ya i’m here
23:57:18shashlick@zacharycarter do you use -f:ast2
23:57:29*fredrikhr quit (Quit: Client Disconnecting)
23:59:49*ftsf joined #nim