<< 30-05-2020 >>

00:00:08Yardanicohttps://i.imgur.com/wiAMMqK.png :P
00:02:11codichm
00:02:11FromGitter<Knaque> Right, well, it's become clear to me that it's not the most straightforward thing to do. I only *really* care about Windows for what I'm working on, so I can skip on Linux support. I could also do it in something other than Nim, if that would be easier.
00:02:26Yardanico@Knaque well I just gave you a link to registry module
00:02:28Yardanicoand it seems quite easy
00:02:39Yardanicojust make sure your app is started with admin privileges and set the registry variable
00:02:52codicbtw, what font is that? :P
00:02:52codicKnaque: just setUnicodeValue the reg key, you'll have to do this in all languages anyways
00:02:59Yardanicocodic: IBM Plex
00:03:01FromGitter<Knaque> And that should be permanent?
00:03:05Yardanicoyes
00:03:07codicah ok
00:03:08codicyes
00:03:21codicfor linux, just append to /etc/environment `KEY=VALUE`
00:03:32Yardanico" To programmatically add or modify system environment variables, add them to the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment registry key, then broadcast a WM_SETTINGCHANGE message with lParam set to the string "Environment"."
00:03:44codicor /etc/profile
00:03:47codicboth are systemwide, of course, and both require root permissions to launch the app (ya can't work around that)
00:03:52codicit's just a limitation with windows and linux
00:04:21codicyeah, so setUnicodeValue HKEY_LOCAL_MACHINE and add the key. not really familiar with how win registry works so cant help more
00:04:33Yardaniconeither am i :D
00:04:39codicalso, the registry module has a const HKEY_LOCAL_MACHINE if neded it
00:04:43codic*if it's needed
00:04:47codic:p
00:05:36FromGitter<Knaque> I'll give that a shot, then. Thanks for the help.
00:08:21FromDiscord<Technisha Circuit> Is Tensorflow a good choice for making a chat bot in Nim?
00:08:34Yardanicowat
00:08:38Yardanicomaybe you meant dialogflow?
00:08:45FromDiscord<Technisha Circuit> (edit) 'bot' => 'ai'
00:08:58FromDiscord<Technisha Circuit> I meant ai, not bot :p
00:09:04Yardanicowell if you have time to wrap tensorflow in nim, sure
00:09:16Yardanicoit could be done since tensorflow can be used from c++
00:09:18*dadada quit (Ping timeout: 265 seconds)
00:09:27Yardanicobut I doubt that you would be able to do that on the phone :P
00:09:31Yardanicono offence
00:10:00Yardanicosince tensorflow is quite big
00:10:14FromDiscord<Technisha Circuit> Already a C++ wrapper for it
00:10:27Yardanicowell then it should be possible
00:10:34FromDiscord<Technisha Circuit> https://goo.gl/search/Tensorflow+for+Nim↵MartinR20/tensorflow.nim
00:10:59FromDiscord<Technisha Circuit> https://github.com/MartinR20/tensorflow.nim
00:11:02Yardanicowhy not try arraymancer first though? :P
00:11:08Yardanicodepends on what you want to do of course
00:12:06Yardanicofor a chat bot I'd really suggest trying dialogflow
00:12:40FromDiscord<Technisha Circuit> What's arraymancer? And i want to try making a chat ai and then some cli games with an ai
00:12:48Yardanicowhat do you mean by "ai"
00:12:55Yardanicohttps://github.com/mratsim/Arraymancer
00:12:56FromDiscord<Technisha Circuit> Well
00:13:03Yardanicoand why dialogflow isn't enough for you
00:13:23FromDiscord<Technisha Circuit> A neural network to complete the game i made
00:13:34Yardanicowell that's not easy to do, but sure
00:13:42FromDiscord<Technisha Circuit> Nice
00:14:42FromDiscord<Technisha Circuit> Where's dialogflow? I can't find it
00:14:50Yardanicohttps://dialogflow.com/
00:14:55FromDiscord<Technisha Circuit> O
00:15:06Yardanicogoogle's cloud-based NLP solution
00:15:25*dadada joined #nim
00:15:30FromDiscord<Technisha Circuit> Oo
00:15:42Yardanicowell it wasn't made by google initially, but google bought the startup
00:15:49*dadada is now known as Guest78561
00:15:57FromDiscord<Technisha Circuit> Nice
00:15:58Yardanico"Google bought the company in September 2016[6] and was initially known as API.AI"
00:16:18zacharycarterwit.ai is pretty good too
00:16:25zacharycarterI used that recently in a hackathon for a chat bot
00:16:32Yardanicooh yeah i need to try wit.ai too
00:16:43Yardanicobut dialogflow actually has some more functionality :P
00:16:49Yardanicobut wit.ai is completely free
00:17:04zacharycarterwell except fb owns all your data
00:17:09zacharycarterbut google probably does too with dialogflow
00:17:30Yardanicooh wit.ai is by facebook? didn't know
00:28:07FromDiscord<Technisha Circuit> How to use choosenim to install the latest nightly version?
00:34:40FromDiscord<lex> hi hi!
00:34:45FromDiscord<Technisha Circuit> Heya
00:34:58FromDiscord<lex> sent a long message, see http://ix.io/2nM9
00:35:08FromDiscord<lex> (edit) 'long message,' => 'code paste,' | 'http://ix.io/2nM9' => 'http://ix.io/2nMa'
00:35:11Yardanicodo you have docopt installed?
00:35:15FromDiscord<lex> yep
00:35:18FromDiscord<lex> (edit) 'http://ix.io/2nMa' => 'http://ix.io/2nMb'
00:35:20Yardanicowell doesn't seem so :P
00:35:21FromDiscord<lex> I ran `nimble install docopt`
00:35:25FromDiscord<lex> I know ffs
00:35:30FromDiscord<lex> its likely a local/global package issue
00:35:34FromDiscord<lex> i had this with conan as well
00:35:35Yardanicoah you're running nimble build?
00:35:39FromDiscord<lex> yep
00:35:41FromDiscord<lex> am i not meant to
00:35:41Yardanicoif you run that you need to specify docopt in your .nimble file too
00:35:50FromDiscord<lex> wait
00:35:54FromDiscord<lex> why wouldnt it be in there automatically
00:36:08Yardanicobecause nimble reads your .nimble file for all packages it requires
00:36:13Yardanico"nim c" and "nimble c" are different
00:36:15FromDiscord<lex> doesnt it add it in there already like `npm` or `yarn` with `package.json`?
00:36:23Yardanicowith "nim c -r" it will work, yes
00:36:32Yardanicobut not with "nimble build" unless you add it in your .nimble file in your project
00:36:36FromDiscord<lex> ok, so I've gotta add it to the nimble file manually
00:36:37FromDiscord<lex> ok
00:36:38FromDiscord<lex> awesome
00:36:41FromDiscord<lex> thanks man! lets give it a try
00:37:35FromDiscord<lex> yeah, worked fine. cheers
00:37:37FromDiscord<lex> though
00:37:42FromDiscord<lex> are there any other CLI parsers that I could use
00:37:52FromDiscord<lex> if im honest, docopt isn't really my cup of tea but its the best thing I found
00:37:55Yardanicocligen
00:38:05Yardanicohttps://github.com/c-blake/cligen
00:38:09FromDiscord<lex> cligen seems a bit odd
00:38:11FromDiscord<lex> dunno why
00:38:27FromDiscord<lex> might need to peep some examples
00:38:51FromDiscord<lex> ugh lool
00:39:01FromDiscord<lex> all these cli frameworks are based so heavily on python ones
00:39:09*Guest78561 quit (Ping timeout: 258 seconds)
00:39:15Yardanicohttps://nim-lang.org/docs/parseopt.html then
00:40:17FromDiscord<lex> id rather use docopt man thanks though hahaha
00:40:28FromDiscord<lex> could write a wrapper around it to make it more procedure based
00:40:30FromDiscord<lex> also
00:40:40FromDiscord<lex> procedures are basically functions right
00:41:03Yardaniconim has both procedures and functions, which more accurately represents them in a mathematical sense
00:41:12Yardanico"func" is a proc with {.noSideEffect.}
00:41:23FromDiscord<Zed> How hard would it be to implement offline docs for standard libraries? ↵eg: `nim --help:strutils` would show all the documentation for that library and so on for all standard libraries
00:41:38Yardanicoi think that's already been done a few times with different libraries/tools
00:41:40FromDiscord<lex> oh I see
00:41:42FromDiscord<lex> question mate
00:41:54FromDiscord<lex> so obviously ive got this
00:41:57FromDiscord<lex> sent a code paste, see http://ix.io/2nMh
00:42:02FromDiscord<lex> what do i do regarding, well
00:42:06FromDiscord<lex> getting anything that comes after `init`
00:42:31Yardanicowell, refer to docopt docs?
00:42:42Yardanicohttps://github.com/docopt/docopt.nim the first example is quite explanatory I think
00:42:46FromDiscord<lex> true lol
00:42:48FromDiscord<lex> thanks
00:45:15FromDiscord<Technisha Circuit> > How to use choosenim to install the latest nightly version?↵:p
00:45:18Yardanicoidk
00:45:21Yardanicoi dont use choosenim
00:45:23*dadada joined #nim
00:45:46*dadada is now known as Guest98013
00:45:49Yardanicoafaik choosenim supports two notions of "nightly" though
00:45:54Yardanicolatest commit and latest nightly build
00:45:57Yardanicowhich one do you need?
00:46:59FromDiscord<lex> what am I doing wrong
00:47:05FromDiscord<lex> doesnt seem to want to work
00:47:05FromDiscord<lex> sent a code paste, see http://ix.io/2nMi
00:47:30FromDiscord<lex> ah shit
00:47:33FromDiscord<lex> gotta use <>
00:47:59FromDiscord<lex> im assuming I can write modular code with nim right
00:48:09Yardanicoyes
00:48:28Yardanicohttps://nim-lang.org/docs/manual.html#modules
00:48:36*lritter quit (Ping timeout: 256 seconds)
00:48:56FromDiscord<lex> thanks!!
00:49:08*lritter joined #nim
00:53:59FromDiscord<lex> how can i iterate through an array
00:54:00FromDiscord<lex> i.e.
00:54:01FromDiscord<lex> "args"
00:54:38Yardanicofor val in args["somevar"]: stuff
00:54:46YardanicoI think
00:54:48YardanicoI didn't really use docopt :_)
00:54:55FromDiscord<lex> ahha thats alright man
00:54:58FromDiscord<lex> see
00:55:00FromDiscord<lex> what im trying to do
00:55:01Yardanicothere are https://github.com/docopt/docopt.nim/tree/master/examples
00:55:08FromDiscord<lex> alright yeah
00:55:09FromDiscord<lex> thats cool
00:55:10FromDiscord<lex> thanks man
00:55:17Yardanicolike https://github.com/docopt/docopt.nim/blob/master/examples/odd_even.nim
00:55:44Yardanicodocopt documentation is on http://docopt.org/
00:55:51FromDiscord<lex> cheers!
00:55:52Yardanicothis lib is a nim implementatiuon of docopt
00:57:58FromDiscord<lex> whats the diff between a proc and method again
00:58:03FromDiscord<lex> and which is better to youu
00:58:05FromDiscord<lex> (edit) 'youu' => 'use'
00:58:09Yardanicostatic vs runtime dispatch
00:58:14Yardanicoin most cases you should be fine with proc
00:58:18FromDiscord<lex> ah alright
00:58:22FromDiscord<lex> could you elaborate?
00:58:27FromDiscord<lex> I just wanna know what im getting into 😅
00:58:29Yardanicoruntime dispatch (methods) is only needed when you have inheritance
00:58:31YardanicoOOP
00:59:07FromDiscord<lex> aha
00:59:07FromDiscord<lex> I see
00:59:08FromDiscord<lex> alright
00:59:11FromDiscord<lex> cheers!!
00:59:12Yardanicoyou don't exactly need OOP in nim, like the compiler itself doesn't use methods at all
00:59:24FromDiscord<lex> yeah no thats fair enough
00:59:25Yardanicothere are other ways like generics, object variants, etc
01:00:49*konvertex quit (Ping timeout: 264 seconds)
01:08:59*Guest98013 quit (Ping timeout: 246 seconds)
01:11:04FromDiscord<codic> Does choosenim support unstable?
01:11:10FromDiscord<codic> The latest nightly binary specifically
01:11:10Yardanicodepends on what you mean
01:11:16Yardanicoi think it does
01:11:25FromDiscord<codic> Since path configuration with the tar xz is a big pain.
01:11:27FromDiscord<codic> ah, yay. how?
01:11:48FromDiscord<codic> do I make use of it
01:12:03Yardanicochoosenim update devel
01:12:15Yardanicoand choosenim update devel --latest build latest commit
01:12:24Yardanico"choosenim update devel" download latest nightly
01:12:34FromDiscord<codic> Niice
01:12:47Yardanicowell first of all you need "choosenim devel"
01:13:04FromDiscord<codic> where do i get choosenim from
01:13:11Yardanicohttps://github.com/dom96/choosenim
01:13:15FromDiscord<codic> ah
01:13:16FromDiscord<codic> ok
01:13:18Yardanicohttps://github.com/dom96/choosenim#unix
01:13:30FromDiscord<codic> Ik
01:13:31FromDiscord<codic> Getting that
01:14:02FromDiscord<codic> Uhhh
01:14:06FromDiscord<codic> sent a code paste, see http://ix.io/2nMr
01:14:07FromDiscord<codic> But I have clang...
01:14:14*krux02 joined #nim
01:14:17Yardanicobut is it the default one?
01:14:20FromDiscord<codic> which clang and which clang++ both work
01:14:22Yardanicotry "cc"
01:14:23FromDiscord<codic> how do i set the default?
01:14:28FromDiscord<codic> command not found
01:14:30*krux02 quit (Remote host closed the connection)
01:14:34Yardanicothat's your problem
01:14:58Yardanicoalso what are you trying to install choosenim on?
01:14:58FromDiscord<codic> ah hold on, solus provides that via system.devel
01:15:01FromDiscord<codic> solus
01:15:06Yardanicoah ok then
01:15:07FromDiscord<codic> 64bit
01:15:10FromDiscord<codic> amd64 specifically
01:15:14Yardanicobut yeah, you need "cc" or have $CC
01:15:22Yardanico@codic I know solus is amd64 only anyway
01:15:24FromGitter<kaushalmodi> codic: https://gist.github.com/genotrance/fb53504a4fba88bc5201d3783df5c522/raw/travis.sh
01:15:25*dadada__ joined #nim
01:15:29FromGitter<kaushalmodi> Use the `--latest` switch
01:15:36Yardanico@kaushalmodi that's not what he wanted
01:15:42Yardanicohe wants a nightly build, not latest commit
01:15:42FromDiscord<codic> Yeah ofc↵No, I want the binaries
01:15:53FromDiscord<codic> cc works now
01:15:56Yardaniconice
01:15:57Yardanicotry it agian
01:15:57FromDiscord<lex> solus!!
01:16:00FromDiscord<codic> i am
01:16:07FromDiscord<codic> nice, it's installing
01:16:08FromDiscord<lex> send us your neofetch | lolcat
01:16:20FromDiscord<codic> can i remove the normal version and get devel?
01:16:23FromDiscord<codic> umm... sure
01:16:59Yardanico@codic did you really read choosenim readme?
01:17:03Yardanico"Optional: You can specify the initial version you would like the init.sh script to install by specifying the CHOOSENIM_CHOOSE_VERSION environment variable."
01:17:18Yardanicoidk how to remove though
01:17:32FromDiscord<codic> @lex here, although I just had to reinstall because i broke something, so still gotta configure it https://media.discordapp.net/attachments/371759389889003532/716097930200875018/unknown.png
01:17:34FromDiscord<codic> oh, nice
01:17:39FromDiscord<Technisha Circuit> > latest commit and latest nightly build↵Preferably newest commit :p
01:17:46FromDiscord<codic> --latest
01:17:50Yardanicochoosenim devel --latest
01:17:53FromDiscord<codic> choosenim update devel --latest
01:17:56FromDiscord<codic> oh
01:18:00FromDiscord<Technisha Circuit> Thanks :P
01:18:00FromDiscord<lex> @codic https://media.discordapp.net/attachments/371759389889003532/716098049545338910/unknown.png
01:18:01Yardanicoupdate is when you already have it
01:18:11FromDiscord<codic> @lex nice, #offtopic?
01:18:16FromDiscord<lex> ya sure
01:18:42*chemist69 quit (Ping timeout: 260 seconds)
01:20:14*chemist69 joined #nim
01:20:16FromDiscord<codic> aaaaah can't figure out how to remove
01:21:45Yardanicoremove the foler
01:21:47Yardanicofolder*
01:21:52Yardanicoin ~/.nimble/toolchains somewhere
01:21:57Yardanicoor ~/.choosenim idk
01:22:19FromDiscord<codic> rm -rf .{choosenim,nimble}
01:22:20FromDiscord<codic> there
01:23:00Yardaniconice
01:23:06Yardanicoyou also removed all your nimble packages with that command
01:23:16Yardanicoand even choosenim itself maybe
01:23:32FromDiscord<codic> i didn't have any
01:23:40FromDiscord<codic> and i can redownload anyways
01:24:49FromDiscord<codic> just to be safe, `CHOOSENIM_CHOOSE_VERSION=devel wget -qO - https://nim-lang.org/choosenim/init.sh | sh`?
01:25:35YardanicoI guess
01:25:40Yardanicoas I said I don't use choosenim at all
01:25:44Yardanicolast time I used it was in 2018 maybe
01:25:50FromDiscord<codic> ¯\_(ツ)_/¯
01:26:02FromDiscord<codic> aah that installed stable
01:26:03FromDiscord<codic> whatever
01:33:40FromGitter<bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ed1b7f4b101510b20271b39]
01:33:50FromGitter<bung87> am I doing right ?
01:36:27FromDiscord<codic> aaa i need a good way to get the nightly
01:37:20Yardanicojust download it
01:38:42*bjornroberg quit (Quit: leaving)
01:39:02*dadada__ quit (Ping timeout: 256 seconds)
01:39:34FromDiscord<codic> i did
01:39:37FromDiscord<codic> keeps complaining nim isnt in path
01:39:57FromDiscord<codic> also i cant find v1.3 for amd64
01:40:01FromDiscord<codic> only 1.2.1
01:40:41Yardanico@codic well you should either add the dir in path or symlink the binary to a place which is in path
01:40:55Yardanico@codic https://github.com/nim-lang/nightlies/releases/tag/2020-05-28-devel-fe7a2d6
01:40:59Yardanicoah nvm
01:41:13FromDiscord<codic> no amd in there
01:41:16FromDiscord<codic> > @codic well you should either add the dir in path or symlink the binary to a place which is in path
01:41:20FromDiscord<codic> ok, will do in /etc/environment
01:43:49bungI realize no need to do that
01:45:23*dadada joined #nim
01:45:47*dadada is now known as Guest89423
01:46:24FromDiscord<Technisha Circuit> How do i use symlinks :∆
01:46:31Yardanicoln --help
01:46:39FromDiscord<Technisha Circuit> I've never used them before 😅
02:03:51FromDiscord<Technisha Circuit> Is there a way to make it so when I'm using the js backend, any variable names i define are the exact name and not `name_829292` or something like that?
02:04:44FromDiscord<Technisha Circuit> I'm focusing on nodejs specifically
02:04:46Yardanicowhy would you want that?
02:05:19FromDiscord<Technisha Circuit> Because then my friends bot wouldn't be able to register commands made with Nim
02:05:55FromDiscord<Technisha Circuit> (edit) 'Because then my friends bot wouldn't be able to register commands made with Nim ... ' => 'Because then my friends bot wouldn't be able to register commands made with Nimvia the js backend'
02:06:03*opal quit (Ping timeout: 240 seconds)
02:06:08Yardanicostill don't really understand what you mean
02:06:17Yardanicoyou know "asm" exists, right? it allows you to write js code inline in nim code
02:06:18Yardanicoalso emit
02:06:24Yardanicoalso importc
02:06:54FromDiscord<Technisha Circuit> Basically, the command handler he made needs the exact variable name `name` in the code to register a command
02:06:58FromDiscord<Technisha Circuit> Otherwise it won't work
02:07:15FromDiscord<Technisha Circuit> (edit) 'command' => 'command, similar issue for the rest of the code'
02:07:41Yardanicovar name {.exportc.} = 5
02:07:46Yardanicoand in JS it will be just "name"
02:08:18FromDiscord<Technisha Circuit> But I'm using the js backend :P
02:08:21Yardanicosame
02:08:25Yardanicoimportc works for the JS backend too
02:08:27Yardanicoand exportc
02:08:33Yardanico(I just tried)
02:08:37FromDiscord<Technisha Circuit> (also i never knew variables work with pragmas)
02:08:39FromDiscord<Technisha Circuit> Oh nice
02:08:43FromDiscord<Technisha Circuit> Thanks!
02:09:17*Guest89423 quit (Ping timeout: 256 seconds)
02:15:22*dadada__ joined #nim
02:24:13*dddddd quit (Ping timeout: 264 seconds)
02:25:10*theelous3 quit (Read error: Connection reset by peer)
02:26:46*opal joined #nim
02:27:05*muffindrake quit (Ping timeout: 272 seconds)
02:28:45*muffindrake joined #nim
02:29:11*rockcavera quit (Remote host closed the connection)
02:38:56*dadada__ quit (Ping timeout: 246 seconds)
02:45:30*dadada joined #nim
02:46:02*dadada is now known as Guest77347
02:46:53*monok joined #nim
02:49:25*mono quit (Ping timeout: 264 seconds)
03:09:49*Guest77347 quit (Ping timeout: 264 seconds)
03:15:27*dadada__ joined #nim
03:39:38*dadada__ quit (Ping timeout: 272 seconds)
03:45:25*dadada joined #nim
03:45:48*dadada is now known as Guest39276
03:50:23*arecaceae quit (Read error: Connection reset by peer)
03:50:55*arecaceae joined #nim
03:53:32*nsf joined #nim
03:54:26disruptekmy serializer takes 0.37s to write 140mb of data with refc, 0.85s to deserialize it from a file. 0.65s to deserialize it from a string. this data takes a full second to check the hash.
03:55:05disruptekunder arc, the serialization takes 0.45s but the read takes 0.36s and reading from a string is only 0.22s. just checking the hash is 0.40s.
03:55:16disruptekarc is starting to lay down some big numbers.
03:56:00disrupteknot bad for just changing a cli option.
03:58:55zacharycarteryou get a job yet?
03:59:17disrupteknot yet.
03:59:23zacharycarterslacker
03:59:30zacharycartercome be a disgruntled python developer with me
03:59:51disruptekhmm.
03:59:56disruptekit's austin, right?
04:00:02zacharycarteryeah
04:00:14disruptekwhere's the ad?
04:00:22zacharycarterour company got listed in Forbes 25 startups most likely to reach a billion dollar valuation
04:00:26zacharycarterlike two days ago
04:00:38disruptekyou make coffins?
04:00:48zacharycarterif you give any creedence to those types of articles - which I don't
04:01:02zacharycarterwe ship them
04:01:16disruptekoh right, it's logistics?
04:01:31zacharycarterhttps://shipwell.com/careers/
04:01:33zacharycarteryeah
04:02:26disruptekis that a real photo of the pen?
04:02:29disruptekthe bullpen?
04:02:30disruptekchrist.
04:02:45zacharycarterI'm so glad I never have to work in a office again
04:02:50zacharycarteran office
04:03:05zacharycarterthey need to get rid of that photo, especially post-covid
04:03:31zacharycarterbut yeah - when I was applying that photo made me hesitate - thankfully the dev teams were ina wework office across the street
04:03:42zacharycarteralso - I don't think you'd need to move to Austin necessarily
04:03:51zacharycarterthey'd probably hire you and let you work where you're at
04:04:35disrupteki can't scroll this web-page without it jumping around like cypress fucking hill.
04:04:41zacharycarterlol
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:36*supakeen joined #nim
04:06:43*waleee-cl quit (Quit: Connection closed for inactivity)
04:07:24disruptekyou do backend stuff?
04:07:49zacharycarteryeah backend and devops
04:08:00zacharycarterright now they have me building out a data pipeline for the data science team
04:08:05zacharycarterwhich is like four people fresh out of college
04:08:18zacharycarterand I'm totally shirking the responsibility by telling them to buy databricks
04:08:30zacharycarterbut that's just because I don't feel like writing terraform for the rest of my time there
04:08:36zacharycarterwhich is the alternative
04:08:49disruptekyou're making my sphincter clench.
04:08:56zacharycartermine is already in my mouth
04:09:12*Guest39276 quit (Ping timeout: 256 seconds)
04:09:20zacharycarterI'd just go find a job doing systems programming honestly
04:09:28zacharycarterthat's what I'd do if I was better at comp sci
04:09:48zacharycarterand will do once I complete about a billion more leet code problems
04:10:11zacharycarterapp development is the pits
04:10:51disruptekit's a grind.
04:11:22zacharycarterI mean - I think it's fine if you work with smart people
04:11:44zacharycarteror people that actually care about computer science
04:12:07zacharycarterbut the vast majority of app dev jobs now a days are filled with programmers who don't care
04:13:00disrupteki dunno, i don't care enough to win contests or interviews.
04:13:01zacharycarterand who do stupid shit - like build tons of microservices that all communicate with eachother using HTTP / JSON
04:13:43disruptekthe thing is, that's the fabric we have to work with.
04:14:24disruptekit's like the '90s and word documents.
04:15:13zacharycarterwell - I think there are smart people out there and you don't need to pass a google / amazon / microsoft / fb interview to work with them
04:15:26zacharycarterjust need to be a bit selective during your application process
04:15:26*dadada__ joined #nim
04:15:40zacharycarterI just went with Shipwell because it was a ticket back to the US and Austin
04:15:40*rockcavera joined #nim
04:15:59disruptekright. it doesn't look bad.
04:16:04zacharycarterit's okay
04:24:49bunga wraped c object has extro field as proc type , when pass it to c api it will work ?
04:49:44leorizewdym?
04:56:13bunghttps://github.com/nim-lang/Nim/blob/3105909f887f2240c2a7a7071b37e1253a70e3e2/lib/wrappers/mysql.nim#L768
04:56:51bungthe c structure only have fields uppon this line
05:00:29leorizeyou mean our structure is bigger than the C version?
05:00:50*narimiran joined #nim
05:04:08bungyes, I just wonder the proc fields will also pass to c api ?
05:05:30leorizeit will, but the C api will work under it's own idea of the object and wouldn't access the additional fields
05:05:55leorizeseems like we get a pass since the API works via pointers
05:06:44bungok , I understand that.
05:13:11FromDiscord<SeanOMik> What's the easiest way to parse a ISO8601 timestamp
05:13:26FromDiscord<SeanOMik> The timestamp is given in a string btw
05:18:57bung!repo timestamp.nim
05:19:27bung!status
05:19:37bungok, https://github.com/jackhftang/timestamp.nim
05:19:43Prestigerip bot
05:19:54leorizedisruptek: did you turn disbot off again?
05:21:36*disruptek quit (Ping timeout: 272 seconds)
05:21:36*disbot quit (Ping timeout: 272 seconds)
05:23:37*disbot joined #nim
05:25:03*disruptek joined #nim
05:28:30bung@leorize I double checked the fields even not considering procs fields, they are also differient fields number and order
05:29:12bungguess that will not be compatible ?
05:29:14leorizeoh now that's a problem
05:29:16leorizeyea
05:29:56bunghttps://dev.mysql.com/doc/refman/5.6/en/c-api-prepared-statement-data-structures.html
05:30:27bungI checked it from document, let me check some other programming language source code.
05:34:15leorizeI'd say check mariadb docs
05:34:21leorizethat's what everyone uses nowadays
05:38:17bungok
05:50:30*opDispatch quit (Quit: Konversation terminated!)
05:55:23leorize[m]bung: actually double check with the headers
05:55:44leorize[m]the docs might not reflect how the structure is defined
05:59:29*dadada__ quit (Ping timeout: 246 seconds)
06:00:21*dadada joined #nim
06:00:55*dadada is now known as Guest71876
06:01:03bungyeah, I downloaded the c source from mariadb
06:01:21bunghttps://file.io/3KfazvzI see they are differient
06:04:16bung@leorize
06:19:38*narimiran quit (Quit: leaving)
06:22:54*solitudesf joined #nim
06:32:47leorizegot 404
06:40:32bunghttps://file.io/kqGz3ns1
06:41:00bungoh ,I forgot it's one time click limited.
06:53:43Yardanicotransfer.sh or ix.io
06:55:30bungok I'v configered transfer.sh
06:56:05bunghttps://transfer.sh/J7nhl/Screenshot-2020-05-30-at-1.58.08-PM.png
06:57:12*aeverr_ joined #nim
06:57:13*aeverr quit (Read error: Connection reset by peer)
07:01:27Araqcommunity, please help this guy https://forum.nim-lang.org/t/6389
07:01:45Araq(I am too busy fixing bugs)
07:02:36bunglet me check
07:04:12YardanicoAraq: fwiw their code works for me on latest devel :P
07:04:22Yardanicoah nvm no
07:05:55*Romanson joined #nim
07:06:32*tdc joined #nim
07:09:26bungmy guess he should always using kstring
07:09:37Yardanicoit fails in actionAddThing
07:10:03Yardanicobecause nodes are null
07:10:35Yardanicowell .isNil returns false but if I try to echo them I get a null exception in js :P
07:10:58bungthe dollar Thing returns string
07:11:29Yardaniconah i'm not about that
07:11:39Yardanicoit fails because getVNodeById returns nothing
07:11:40Yardaniconull
07:11:43Yardanico(in JS it's null)
07:13:29Yardanicooh wait so actually the nodes aren't null
07:13:33Yardanicobut .value() returns null
07:16:55bunghmm cant be that I guess , It just call .value isn't it ?
07:17:00Yardanicowell it can
07:17:02Yardanico.value() returns null
07:17:06Yardaniconil in nim
07:17:23Yardanicomaybe calling value is incorrect there? idk js or karax really :D
07:21:54bunghmm it's a property I searched the karax doc
07:22:27YardanicoI don't think it's the right way to get a value from input
07:23:12Yardanicovalue only exists for VNodeKind.text
07:23:36Yardanicoand input itself *is not* text
07:23:58bungso inputNode.value
07:24:01Yardanicono
07:24:38bunghttps://github.com/pragmagic/karax/search?p=1&q=.value&unscoped_q=.value
07:24:51Yardanicoyes, so as you can see there's no place where it's set implicitly
07:24:56Yardanicoso you have to create your own component to have it
07:29:29bungah , he mixed the traditional web tecnics and vdom
07:29:59Yardanicoye
07:30:43bunghmm , got no benefit by using karax..
07:31:55bunglet me give some tip to him
07:43:14FromGitter<eagledot> Are there nim bindings available for openCV based on C++ Api ?
07:44:45Yardanicodon't think so
07:44:56Yardanicoah well there's https://github.com/xomachine/opencv2-nim but last commit in 2015
07:48:00*gargle joined #nim
07:48:33gargleHi. What would be the best way to start with a rest api server in Nim?
07:48:51Yardanicogargle: I guess reading https://nim-lang.org/docs/json.html and using https://github.com/dom96/jester ?
07:49:50Yardanicofor the DB you can use https://github.com/moigagoo/norm
07:50:07FromGitter<eagledot> Is there anyway i can access webcam using any nim's library?
07:50:28Yardanicodon't know, sorry :( you might ask on the forum
07:50:38garglewill this work on Windows? How is it with concurrency/parallelism?
07:50:45garglei want something like go
07:50:50garglego's net/http
07:50:53Yardanicogargle: 1) yes 2) on windows - not really good, but on *nix it's fine
07:51:01garglehmmmmmm
07:51:04Yardanicojester uses httpbeast on *nix platforms which allows it to have threaded async
07:51:29Yardanicowell I mean concurrency will be fine
07:51:32Yardanicoasync works fine on windows
07:51:53Yardaniconot parallelism though, for that you'll have to create threads yourself or use something like Weave (for computational heavy tasks)
07:52:33*solitudesf quit (Remote host closed the connection)
07:53:04*nsf quit (Quit: WeeChat 2.8)
07:53:23garglethankie
07:53:57*solitudesf joined #nim
07:56:37*gargle quit (Remote host closed the connection)
07:59:15*idf joined #nim
08:03:08*defection joined #nim
08:03:43*defection quit (Client Quit)
08:24:09*fredrikhr joined #nim
08:27:29*neceve joined #nim
08:42:54*Guest71876 quit (Ping timeout: 256 seconds)
08:45:25*dadada joined #nim
08:45:49*dadada is now known as Guest8421
08:45:50*Trustable joined #nim
09:14:30*Romanson quit (Quit: Connection closed for inactivity)
09:20:21*konvertex joined #nim
09:28:47*chemist69 quit (Ping timeout: 246 seconds)
09:29:45*chemist69 joined #nim
09:35:47alehander92oi
09:35:51alehander92blessed morning
09:36:25alehander92i am going to try to write some todo-s now
09:37:30Zevvmaybe you should put trying to write some todo-s on the top of your todo list
09:37:51Zevvyou know that feeling, when you are trying to accomplish something, you end up in this recursive tree of trivialities?
09:40:48FromGitter<bung87> or finished a todo liat then create another todo list
09:43:26alehander92yeahhh
09:43:36alehander92actually no
09:43:39alehander92i just like todos
09:50:23*Guest8421 quit (Ping timeout: 258 seconds)
09:58:36*dddddd joined #nim
10:00:26*dadada joined #nim
10:00:56*dadada is now known as Guest55682
10:01:25dom96'morning
10:02:20livcdevening )
10:18:55FromDiscord<KrispPurg> Is there an libopus library for Nim?
10:19:01FromDiscord<lex> like
10:19:02FromDiscord<KrispPurg> (edit) 'libopus' => 'opus'
10:19:04FromDiscord<lex> for opus-voice
10:19:05FromDiscord<lex> discord bots
10:19:10FromDiscord<KrispPurg> yes
10:19:25FromDiscord<lex> I have no clue, best taking a look at discordnim
10:19:34YardanicoLMAO
10:19:38FromDiscord<KrispPurg> wow
10:19:46FromDiscord<lex> ????
10:19:50FromDiscord<lex> why LMAO fffffssssss
10:19:56Yardanicokrisppurg is the creator of dimscord
10:19:58FromDiscord<KrispPurg> discordnim doesn't have voice lol
10:20:02FromDiscord<lex> oh
10:20:02Yardanicoand discordnim is pretty bare
10:20:05FromDiscord<lex> fuck sake
10:20:09Yardanicoand abandoned
10:20:12Yardanico@krisppurg https://github.com/search?q=language%3Anim+opus&type=Code
10:20:17FromDiscord<lex> oh ffs
10:20:17FromDiscord<KrispPurg> its okay
10:20:18FromDiscord<lex> you are
10:20:19FromDiscord<lex> LMAO
10:20:56FromDiscord<lex> oop-
10:20:57FromDiscord<lex> sorry mate
10:21:13FromDiscord<KrispPurg> holy damn, looks like I'm off to voice making then.
10:21:22FromDiscord<lex> good luck mate
10:22:00FromDiscord<KrispPurg> thanks I guess.
10:23:44*FromDiscord quit (Remote host closed the connection)
10:23:59*FromDiscord joined #nim
10:24:35*Guest55682 quit (Ping timeout: 265 seconds)
10:29:54alehander92dom96
10:29:59alehander92how is it
10:30:18alehander92how is the game going?
10:30:22dom96good
10:30:27*dadada__ joined #nim
10:30:29dom96Submitted to Google Play
10:30:44dom96Gonna do some final things today and hopefully attempt to advertise it more widely
10:31:06dom96Could use someone help in breaking it though :)
10:32:45alehander92awesome
10:33:24alehander92hm, i am trying to decide between a vm debugger / and detecting blocking calls to play with today
10:33:58Zevvalehander92: I got something to play with for you :)
10:34:06alehander92coro? :D
10:34:09alehander92ok
10:34:22ZevvWell, that will be one of the end results
10:34:31alehander92?
10:34:32Zevvbut we will also replace iterators and closure iterators
10:34:38Zevv:)
10:34:52alehander92i dont know
10:34:52Zevvand finally properly join async and threads
10:35:00alehander92i can help but wouldnt raise my hopes too much :D
10:35:14alehander92so how?
10:35:19ZevvI'm stuck myself anyway, so it can never get worse, haha
10:35:36alehander92is there some kind of irc log for it
10:35:40alehander92or repo
10:35:44Zevvnot really, araq dumped me some papers
10:35:51Zevvthis is my repo: https://github.com/zevv/nimcsp
10:36:00alehander92and said "lets rewrite half of nim concepts"
10:36:10ZevvThere's a computer science trick of transforming a piece of code to fold your control logic inside out
10:36:23alehander92ok sounds useful.
10:36:28Zevvwhen doing that, you effectively get rid of the stack
10:36:56Zevvthere is no classical control flow anymore. Everything always goes "forward" only. I've heard of it and played with it some times in the past but never properly got into it.
10:37:49ZevvThe idea is that after this transformation a function or proc gets cut up in a number of seprate new procs, and at the end of a proc it returns an object with a pointer to the next function, and the data it should take
10:38:10ZevvIts officialy called a "continuation"
10:38:27ZevvYou can call this function right away, but you can also store it and call it when a timeout occures, or when a socket is ready for reading.
10:38:32ZevvAnd then suddenly it is called "asyn"
10:38:34Zevvasync
10:39:27ZevvSo what I was trying to do is digest these papers (parts of it, because some parts of it I don't dare come near) and understand the transform. I've done two tiny transforms by hand to make an async socket server thingy, and put it in an event queue.
10:39:46ZevvAll proves to work, so where I want to go is making a macro that does this transformation for me
10:39:48alehander92so what is the problem
10:40:20Zevvthe last sentence: this transformation. There's some rules to follow, split up, get local variables out, etc - the README shows a tiny example.
10:40:32ZevvAnd I want to know if it would be possible to build a macro that does just that
10:40:51alehander92ok
10:41:00ZevvIf that would work, Nim could transfer any proc to a series of continuations, effectively allowing you to run stuff in parallel by magic
10:41:00alehander92maybe?
10:41:13alehander92so is there an example
10:41:32alehander92of the current manual async code AND
10:41:33Zevvcheck the repo. The readme shows the transformation in some steps, and there's two tiny working examples.
10:41:39alehander92the expected cleaned up api
10:42:03ZevvThe API should probably just a proc with a pragma that invokes the macro.
10:42:16FromDiscord<dom96> TIL there are android phones that have x86 processors
10:42:26ZevvThe end result should be that the macro transforms the given proc to the split up procs as given in the examples. But the user will never see that, of course
10:42:49ZevvAnyway, if this kind of stuff sparks your interest, and you're bored, drop in! :)
10:43:08Zevvdom96: right! But it's mostly settop boxes, not phones.
10:43:54alehander92ok, thank God, i was looking for something useful!
10:43:55ZevvI've been working on a hefty project over the last year where we're running androids in docker and remoting the video and opengl to tiny embedded devices that will then act as if they are running android
10:44:13alehander92so let's call it `{.cps.}`
10:44:24ZevvThat's in my file right now. macro cps() = discard
10:44:27Zevvand now I'm stuck :)
10:44:29alehander92or `{.cont.}`
10:44:42alehander92i have to read exactly cps def
10:44:47alehander92hmmm
10:44:50alehander92so lets see
10:45:15ZevvThere's two papers in the top of the readme, they're from the same author but some years apart. The second goes much deeper.
10:45:57FromDiscord<dom96> Yeah, there is actually some ASUS phones that ran x86
10:46:05ZevvCPS is one of these things that CS guys in the functional world love to do, just like playing with monads and all these kind of poche constructs normal computer engineers don't understand bollocks about
10:46:08FromDiscord<dom96> The Google play dashboard let's you check the devices your APK supports
10:46:10FromDiscord<dom96> it's quite cool
10:46:14alehander92 french people are good with lang design man
10:46:20Zevvha :)
10:46:31livcdwait what where
10:48:14alehander92so cps conversion/lambda lifting/splitting
10:49:20Zevvright. The paper is about doing this in C, and they also have a step they call "boxing", where they move local variables to the heap when someone takes the address, but I think that's something that can wait until later.
10:49:32alehander92ok
10:49:41ZevvAraq mentioned there's some hidden magic available in Nim to do these things, like lifting, but it's undocumented and hardly tested.
10:50:14alehander92i read a "thought tool" link yesterday, so embarrasing, so i will apply one : why do we need it
10:50:48alehander92to make iterators/async/threads simpler/more well cointegrated/more powerful/other?
10:51:16ZevvTo get proper coroutines, or call them fibers. These can be used as tools for doing any "unconventional" program flow without needing compiler/language support.
10:51:18alehander92also, is the lack of stack useful, or is it just a side effect
10:51:34ZevvIt is useful. When you want coroutines, you need a stack for each thread.
10:51:42alehander92ok, so e.g. how would iterators look on top of them
10:51:50ZevvBut in C there is just one stack. There are hacks to get multiple stacks, but these are all slow and/or not portable.
10:52:06ZevvWhen you lose the stack, you are free to continue anywhere in your coded, independed from where you came from.
10:52:13alehander92call the callsite with the yield
10:52:20ZevvSo coroutines, iterators, maybe exception handlers, etc.
10:52:26alehander92e.g. items => yield(to callsite, value) ?
10:53:51Zevvsomething like that. In my toy implementation a continuation is an object of type Cond, which has just a proc pointer. Specific continuations inherit from that object and add the data they want to pass to the proc, like a socket or whatever. These are typically the local variables that used to be on the stack, they get moved into the continuation structure by the lambda lifting.
10:54:17alehander92ok
10:54:32*lritter quit (Quit: Leaving)
10:54:33ZevvThe classical CPS approach uses tail calls to go to the next step, but in practice this usually uses trampolines. You don't call the next guy, but you return the address of the next guy.
10:54:35*dadada__ quit (Ping timeout: 256 seconds)
10:54:43ZevvThe trampoline does "while c: c = c.fn(c.data)"
10:55:30Zevvthat will run until there is nothing more to run. Either your program is done, or the continuations are waiting to be called later by an event queue when a timer expires or a socket is ready
10:55:58ZevvAlso a *very* cool thing is that these continuations could be run on another thread - real thread - if you want.
10:56:22ZevvSo you can make a continuation with a real blocking system call, throw it in a thread pool, and move it back into your own trampoline when it is done.
10:57:19Zevvanyway, that should conclude my ramblings for now, lunchy time!
10:57:21alehander92:)
10:57:27alehander92i will try to write down cps
10:57:31alehander92without understanding !
10:57:44Zevvhaha :)
10:57:57alehander92but i will
10:58:05alehander92try to understand the examples
10:58:07alehander92and think
10:58:08alehander92oook
10:58:34alehander92are there other languages
10:58:41ZevvThe biggest problem is that one of this steps is done be inserting gotos and then moving the goto labeled blocks into procs. That's not something that can be easily represented with NimNodes, so I'm kind of stuck on how to do that part.
10:58:43alehander92which do it in the same way? there should be many i guess
10:58:52ZevvYeah, haskell, ocaml, all the nerdy ones
10:58:54alehander92what i mean is, is there something very unusual about this setup
10:58:58alehander92ah nerd stuff
10:59:10Zevvit's very functional
10:59:20Zevvand not common in imperative languages
10:59:59Zevvalso I think it's just one of those things that does not make sense for mortals. It live in the same dimension as Y-combinators and monads
11:00:24*dadada joined #nim
11:00:53*dadada is now known as Guest13878
11:01:01alehander92ok
11:03:44Zevvaraq started this byw, so blame him
11:08:59*aeverr_ quit (Quit: Konversation terminated!)
11:09:16*aeverr_ joined #nim
11:09:21*aeverr_ is now known as aeverr
11:11:16*Guest13878 quit (Ping timeout: 258 seconds)
11:12:47*dadada__ joined #nim
11:15:47*Trustable quit (Remote host closed the connection)
11:23:57FromGitter<mratsim> @Zevv: https://github.com/zevv/nimcsp#converting-gotos-to-nested-procs
11:24:00FromGitter<mratsim> This is not true
11:24:07FromGitter<mratsim> you have access to gotos in Nim
11:24:26Zevv{.emit.:"goto foo".} ?
11:24:53FromGitter<mratsim> No
11:25:00Zevvmy point also was that these goto's are not really needed - they are a intermediate step for the transformation only
11:25:11FromGitter<mratsim> Run synthesis example state machine with -d:debugSynthesis - https://github.com/mratsim/Synthesis/blob/master/synthesis/factory.nim#L425
11:25:39FromGitter<mratsim> basically "var myEnum {.goto.}: MyEnum"
11:26:00Zevvoh right - I forgot about those. I played with those for npeg once, but could not get them to do what I needed. In the end I just use a computerGoto case in a loop, which gets totally compiled away at the C level.
11:26:03FromGitter<mratsim> and when you assign a new enum value to "myEnum" it goes to that part of the "switch" statement
11:26:55ZevvI'll have to look into these again one day. But then again, it's tied to the switch right? Which doesn't allow the kind of goto's needed in the transformation, which goes in and out blocks and scopes
11:27:01FromGitter<mratsim> you can compile this to study the Nim code generated: https://github.com/mratsim/Synthesis/blob/master/examples/water_phase_transitions.nim
11:27:27Zevvyeah, I've studied that, its funny how it resembles npeg
11:27:28FromGitter<mratsim> if the switch is the "main" top level thing it can
11:27:43FromGitter<mratsim> well you need state machines to implement a parser ;)
11:27:49Zevvtrue, that
11:28:50FromGitter<mratsim> now, we probably want this to work in JS (do we?) so I'm not sure we can make goto work like that there but I might be wrong
11:29:11Zevvno, but see above: the goto's are merely virtual
11:29:31Zevvthey are used as an intermediate step in the transformation as it is described in the docs Araq pointed me to.
11:30:01ZevvBut in the step right after, all goto label blocks are changed into procs and the goto's go away
11:30:09FromGitter<mratsim> okay
11:30:12alehander92mratsim is the guy !
11:30:19alehander92otherwise yeah
11:30:21Zevvsure, tell me about it
11:30:29alehander92one can simulate those with other nodes i think
11:30:32alehander92if its just temp
11:30:44Zevvyou don't have to represent them in-tree I guess
11:31:02Zevvyou can just make notes in your own administration telling "here is a goto" and "here is a destination"
11:31:03FromGitter<mratsim> I don't mind having an in-tree representation
11:31:06Zevvand pick up the SAT from there
11:31:08ZevvAST
11:31:28FromGitter<mratsim> Tasks can be represented as continuation
11:31:36Zevvthat's the whole point
11:31:54Zevvthat's where this should go.
11:32:05FromGitter<mratsim> If those stuff can be saved on the heap with a custom allocator that may be used in Weave
11:32:25Zevvit absolutely makes sense to snuggle with Weave if this will work
11:33:08FromGitter<mratsim> basically ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ed2447427513a72fbc17232]
11:33:40Zevvright
11:33:41FromGitter<mratsim> Executormetadata can be async or multithreading specific
11:33:49FromGitter<mratsim> or simple threadpool
11:34:29Zevvit should be possible to mix and match. You can offload a task to a threadpool if it will do blocking things, and adopt it back in another thread when it is completed.
11:34:30alehander92i think
11:34:33alehander92you should use
11:34:37alehander92a simple seq
11:34:42alehander92or something
11:34:56FromGitter<mratsim> for what?
11:36:00alehander92the
11:36:06alehander92virtual goto stuff in macros sorry
11:36:39FromGitter<mratsim> ah, well I don't really care what is used at compile-time as long as it doesn't increase compile-time too much
11:36:40alehander92ok, the custom allocator thing: is it a part of meta
11:36:49FromGitter<mratsim> no
11:36:58FromGitter<mratsim> it's for the ptr object
11:37:07FromGitter<mratsim> but we might want to make it a simple object
11:37:34FromGitter<mratsim> Memory allocation is the overhead bottleneck in Weave and Rust AsyncIO
11:37:38Zevvfirst make something work, optimize later :)
11:37:53alehander92yeah i see
11:38:05alehander92so about the stack and variables
11:38:06FromGitter<mratsim> I solved it by having a memory pool to handle my channels/futures/flowvar and my Task allocations
11:38:35FromGitter<mratsim> Rust solved it by making the Task an "inline" field of their Future implementation
11:38:38alehander92one thing i dont get is : i can pass them to another thread because the 'stack' would be replaced by heap values / structs
11:38:44FromGitter<mratsim> so they only allocate once instead of 2
11:38:49alehander92can this somehow be applied for process-es too
11:39:02alehander92yeah a custom allocator would make sense
11:39:05FromGitter<mratsim> you should use sockets to share between processes
11:39:15alehander92ok, so one copies between them
11:39:25alehander92yeah thats probably inevitable
11:39:32alehander92but we can use mmap right ?
11:39:37Zevvdon't go there
11:39:43alehander92if we are sure that *some* values are read-only or something
11:39:45FromGitter<mratsim> but mmap is POSIX only
11:39:57alehander92well yeah, but it can still be a valid optimization
11:40:20alehander92it seems windows does have
11:40:24alehander92something similar
11:40:27FromGitter<mratsim> mmm sure but I think this goes beyond the scope of Nim stdlib
11:40:45alehander92but maybe such a file
11:40:59FromGitter<mratsim> I expect if you share huge chunk of data between processes it would be a read-only file on disk or via a DB
11:41:02alehander92mratsim yeah, probably
11:41:25alehander92but this can be slower
11:41:33alehander92i am thinking of stuff like parallel compilation
11:41:36alehander92and similar
11:41:44FromGitter<mratsim> sure, but when you are concerned about sharing speed you use threads anyway not processes
11:41:47alehander92where you might want to just share some shared trees/all kinds of objects
11:41:59alehander92but with threads you dont get multicore parallelism
11:42:07Zevvsure you get
11:42:13FromGitter<mratsim> you get multithreading
11:42:25FromGitter<mratsim> it uses all my cores
11:42:34alehander92hm, so can one do data parallelism
11:43:03FromGitter<mratsim> Run this demo, it will use all your cores: https://github.com/mratsim/weave/tree/master/demos/raytracing
11:44:21alehander92hm ok
11:44:43alehander92i also used `||` and openmp
11:44:48alehander92i just didnt realize how it works
11:44:48FromGitter<mratsim> For me, processes are used to isolate memory addresses
11:44:50alehander92internally
11:44:56*xet7 quit (Remote host closed the connection)
11:45:11FromGitter<mratsim> it transforms the inner "for" scope into a closure
11:45:19FromGitter<mratsim> that captures all the variables used inside
11:45:20alehander92i know weave is different!
11:45:34FromGitter<mratsim> Weave really does the same when you call "parallelFor"
11:45:42FromGitter<mratsim> except that the capturing is explicit
11:45:46alehander92i see
11:45:50FromGitter<mratsim> what is different is the load balancing
11:45:55alehander92ok, sorry for the offtopic
11:46:44alehander92so about the
11:46:46alehander92macro
11:47:44alehander92one can mostly generate a PNode with calls
11:47:48alehander92directly zevv
11:47:55alehander92i dont see why you should generate goto-s
11:48:02alehander92if you just replace them with equivalent calls anyway
11:48:32alehander92just you generate a call<n> instead of goto n
11:48:34alehander92etc
11:52:40Zevvright that was my point
11:52:54Zevvits just a trick to illustrate the transform in the paper
11:53:28Zevvthe problem is that you cant "just generate a call" because you dont know what goes into what proc until youre done
11:53:43Zevvthe gotos are just markers to see where you need tp cut your cake
11:54:15Zevvbut you need to be done cutting before you can wrap them up in procs
11:54:34alehander92then the variables no
11:54:39Zevvthats why I mentioned just making out-of-tree notes of your calls and your targets
11:54:40alehander92ops
11:54:44alehander92maybe
11:54:47alehander92but why do you need it
11:54:50alehander92my understanding is that
11:55:16alehander92if you a while/if: you put a label
11:55:30alehander92so you just start a new procedure with the branch/block anyway instead
11:55:35alehander92and add a call before that
11:56:30alehander92if you have a jump(e.g.cps/ break/continue/return etc) you put a goto
11:58:08alehander92sorry
11:58:13alehander92maybe this doesnt make sense
11:58:19alehander92but i think we can try
11:58:29alehander92otherwise one can always do what you say of course
11:59:29alehander92and you guys are right: one can still just use a seq of indices+goto/label annoation or
11:59:57alehander92even a NimNode with `:cps_reserved_goto`
12:00:06alehander92or something which shouldn't clash
12:00:59Zevvsure
12:05:02alehander92<3
12:05:15alehander92so i guess you would do that
12:05:23alehander92i can work on the macro debugging
12:06:02*supakeen quit (Quit: WeeChat 2.8)
12:06:43*supakeen joined #nim
12:14:43AraqZevv: please make fn*: proc(c: Cont): Cont to be {.nimcall.} so that no hidden state can be accidentically introduced
12:14:53Zevvgood point
12:15:28Zevvhow do you feel about inheriting from Const and genereting a little prelude that takes out the locals, for now
12:15:44ZevvI expect that will get optimized away mostly, and if not, we can do that later
12:16:03Zevv /from Cont/
12:16:44Zevvthat saves me from messing with marshalling for now
12:16:59Zevvand continuations just go on the heap for now as well, I dont care
12:18:24alehander92so
12:18:29alehander92how would exceptions work?
12:19:02FromDiscord<Clyybber> lets ignore them for now :p
12:19:04alehander92one would always pass two paths? one with next function and one with last catch
12:19:09alehander92except*
12:19:27alehander92so one can directly continue to the nearest except instead of going back through each frame
12:19:49alehander92this can make conditins possible
12:19:54alehander92e.g. restart parse
12:20:12alehander92where you jump to a particular checkpoint up in the algorithms
12:20:24Araqalehander92: that's one solution, the proc simply takes 2 continuations, one for the happy path, one for the error path
12:21:04FromDiscord<exelotl> Zevv: will it be zero allocation / work on embedded? i.e. would I be able to use it as a replacement for https://github.com/exelotl/ecolo
12:21:29alehander92awesome
12:21:37alehander92so i read on a ocaml forum about the happy/error path
12:21:45*luis_ joined #nim
12:21:53alehander92but would the restart idea
12:21:55alehander92make sense
12:22:09alehander92(basically a port of the common lisp concept)
12:23:30Araqexelotl: well the point is to avoid the stack, so the cont would be on the heap, but ideally we regain control over the allocations and you can pool them
12:23:50FromDiscord<Recruit_main707> `x := &BoostPadState{}` this code in go, would be transpiled to nim as: `cast[ptr BoostpadState](alloc(sizeof(BoostpadState)))` ? or the gc will hande this in other easier way
12:24:29Araqsounds more like 'x = new BoostPadState'
12:25:16FromDiscord<Recruit_main707> so id rather use refs instead of ptrs?
12:25:53FromDiscord<Recruit_main707> this code will *hopefully* be automatically generated, so i want it to be fast rather than elegant
12:26:31Araqrefs are fine for performance
12:27:05FromDiscord<Recruit_main707> ok, thank you
12:28:53Zevvexelotl: I have no clue how and where this will or will not work. I'm just starting to understand the problem domain
12:29:31ZevvI do *feel* though, that with the absence of stacks, some other form of non-linear memory needs to be provided. That sounds like a heap or pools to me.
12:30:04Zevvwait, what, ecolo
12:30:40FromDiscord<exelotl> Haha that's fair
12:31:05ZevvI'll have to see what's under the hood of ecolo - seems its at least partially doing what I'm trying to do
12:33:39FromDiscord<exelotl> ecolo only works with a few constructs (if, while), and you can only yield from the main script body
12:34:13FromDiscord<exelotl> but its good enough for writinf dialogue scripts in my GBA game :)
12:34:29FromDiscord<exelotl> *writing
12:36:10FromDiscord<exelotl> It's a pretty brute force approach, not based on any papers or formal technique
12:37:31ZevvI'm never feel hindered by my lack of formal techniques. Although I did found out by now that if I really want to get something done, I usually *do* need to get into the formal techniques first.
12:37:40Zevvit's a pain in the behind.
12:53:29alehander92hmm
12:53:36alehander92i feel similarly often
12:53:53alehander92but i do want to get a bit better
12:54:04Zevvnah, I'm over that
12:54:07alehander92it seem that those guys researched many problems that one clashes with
12:54:23ZevvI just do as I like and enjoy the moment
12:54:29alehander92yeah thats also good
12:55:59zacharycarterhttps://github.com/zacharycarter/frag/blob/master/src/fiber.nim
12:56:10zacharycarterbasic building blocks for coroutines
12:56:16zacharycarterfor posix anyway
12:56:35zacharycarterwhich will work in a multithreaded env
12:56:57Araqfibers take up more memory and are less portable than what Zevv is working on
12:56:59Zevvyeah, I looked at that as well. But it is all heavy and non portable
12:57:03zacharycarterah
12:57:32zacharycarterwell, eager to see what you come up with :)
12:57:34Araqand Zevv's stuff is based on formal methods even though he denies it :P
12:57:51Zevvsays the guy who bought the book
12:58:23AraqI also read it
12:58:32zacharycarterwhich book?
12:58:53Araqhttps://www.amazon.de/Compiling-Continuations-Andrew-W-Appel/dp/052103311X
12:58:56zacharycarterthanks
12:59:12zacharycarterohhh so work is starting to be done on that white paper?
12:59:43zacharycarterthat one disruptek was going nuts over a few weekeneds ago
13:00:04ZevvI don't know. I just whined again about not having the flavour of coroutines I prefer, and then this happened
13:00:07Zevvwhat paper is that?
13:00:15zacharycarterlet me try to find it
13:00:32AraqZevv: the one you already know
13:00:39Zevvah ok, cool
13:01:21Zevvdang, my repo is even named wrong. It should be nimcps, not nimcsp, haha
13:01:22zacharycartergood I don't have to find it :P I was struggling
13:02:26leorizeoh, Zevv invented yet another cool thing?
13:02:30leorize!repo nimcsp
13:02:30disbothttps://github.com/zevv/nimcsp -- 9nimcsp: 11Nim CPS (Continuation Passing Style) experiments 15 10⭐ 0🍴
13:03:35Zevvits just toying around really
13:04:27zacharycarterI think it's pretty easy to rename github repos now
13:04:29zacharycarter:P
13:04:32leorizetechnically you can imitate goto in Nim :P
13:04:45ZevvI'll rename i if it works
13:04:47leorizenamed blocks and break are useful for this
13:04:54Zevvleorize: the goto's are a hoax.
13:05:08Zevvthey're not really there
13:08:53*luis_ quit (Quit: luis_)
13:09:23alehander92https://github.com/zacps/blocked
13:09:27alehander92very smart!
13:09:52alehander92one can do this idea for similar ct langs like nim/zig/d probably
13:10:10alehander92i guess also a bit "come on people do this" but its a cool example
13:12:18Araqyou can also accept the fact that compilers still lack the AI technology and some bugs are found by testing
13:13:58*luis_ joined #nim
13:15:27alehander92:)
13:15:34alehander92that's true!
13:15:43alehander92which reminds me to try the vm thing
13:16:22Araqand sometimes performance problems are found by profiling. but it's not as much fun as thinking over type and effect system extensions which we don't base on solid computer science and we then we don't prove correct
13:17:06alehander92that's true
13:17:15alehander92but after all, we know profiling works
13:17:33alehander92searching for alternative ways to check things is not always bad
13:18:03Zevv"prove correct", like on page 28 and on in "the paper"
13:19:04ZevvI printed the paper, took out those pages and use the backside for notes, and one for making a paper plane. Much more fun.
13:19:40ZevvI know lambdas, but you can keep the lemmas
13:20:30Araqalehander92: I prefer "re-search" over "search"
13:20:57ZevvI prefer "re-creation" over "creation"
13:21:53FromGitter<sheerluck> I like mashups
13:23:01Zevvwhat kind of mashups
13:25:26AraqZevv: you don't have to read the proof but without it I wouldn't have considered their approach
13:26:10Araqas we already have enough unsound stuff in Nim
13:26:12Araq;-)
13:27:01alehander92Araq sorry, prooving and soundness are much better indeed!
13:27:10ZevvI feel the same about these things. I'm glad other peoples spent months or years of their lives making sure everthing is provable so I can just use it.
13:27:31ZevvJust as the whole PEG thing. In the end I only learned all the details after implementing, but it is nice to know that someone else made sure it actually works
13:27:47*crem quit (Ping timeout: 240 seconds)
13:29:43Araqdoes it though? how do you handle left-recursive rules?
13:30:38ZevvBy spinning forever and burning your precious CPU cycles until the world comes to an end
13:30:44Araqnah it's ok, you can detect them and produce an error message
13:30:58ZevvI do detect some of them. Others I just added to the doc as "don't do that"
13:31:23Zevvand of course there's pratt precedence in there these days, which helps out for most practical reasons
13:31:58Araqfair enough, most important is that you're aware
13:32:14ZevvI am very aware :)
13:32:28Zevvwould be kind of a shame if I weren't by now, right
13:33:10FromDiscord<mratsim> mmmh there is no codegenDecl for type section?↵↵I want to define a vector type as "VecIntrin[N: static int, T: SomeNumber] {.codegenDecl: "$# __attribute__ ((vector_size (16)))".} = object"
13:34:12leorizeI guess you will have to walkaround this via {.emit.} then importc :P
13:34:20FromDiscord<mratsim> meeeh
13:34:23zacharycarternow both mratsim and I have wanted this feature
13:34:49zacharycarterthe emit / importc solution isn't a goo done
13:34:50Araqand *now* I'm listening :P
13:35:16zacharycarterI just makes sense - if we're compiling to C code we should be able to influence the codegen for type defs
13:35:20FromDiscord<mratsim> https://github.com/numforge/laser/blob/master/benchmarks/vector_math/vector_extension.nim#L2
13:35:21zacharycarterit*
13:36:08FromDiscord<mratsim> bonus point if the 32 and the 8 in the Float32x8 name can be interpolated from static int and the typedesc without forcing C++ compilation mode
13:36:18FromDiscord<mratsim> sott the FLoat32*
13:36:23FromDiscord<mratsim> sorry the float32*
13:39:33AraqZevv: speaking of exceptions, they are very important indeed, you need the same mechanism for timeouts. in fact, timeouts and cancellation should be baked into the design from that start
13:40:59alehander92yeah
13:41:00ZevvWell, I was hoping to get the basic contiuation stuff separate from things like timouts and events. It seems to me that it is a building block that can be used in tons of things, and not only in event loops. That's tier 2
13:41:04alehander92i wanted to ask about cancellation
13:41:14alehander92but i thought its mostly an async thing
13:41:29Zevvcancellation is a matter of aborting the trampoline, not calling the next continuation
13:41:38Zevvand *poof* it's gone
13:41:41alehander92until the cancellation site
13:41:49alehander92its similar to an exception maybe
13:42:05Zevvbut when talking timouts, you already imply things like event loops and schedulers
13:42:23Zevvbut you can also build iterators out of this stuff, and then you don't timeout or cancel
13:42:27leorizeI think once you got cancellation working timeout can be trivially implemented :P
13:42:29Zevvwell, you might cancel
13:42:38AraqZevv: good point but you may need to close sockets on cancel
13:42:52alehander92shouldn't this stuff work even on bare metal
13:43:07alehander92so event loops/timeout should be somehow configurable at least
13:43:08ZevvAraq: all the hard work put in finalizers, and still *I* need to close sockets
13:43:25Araqwell maybe not
13:43:37Araqwe'll see
13:43:47Zevvalehander92: it should work anywhere, as far as I am concerned it is all about the transform into continuation form for now. The rest comes after that.
13:44:01Araqyup, that's the way
13:44:20alehander92<3
13:44:21alehander92ok
13:44:30FromDiscord<mratsim> I wouldn't bake timeouts and cancellations into the design right away
13:44:51ZevvI was afraid this had to be done at the compiler level, so I was not even considering going there. But it might be able to work with macros as well
13:44:52FromDiscord<mratsim> it makes sense for async but not for multithreading for example
13:45:00Zevvmratsim: right
13:45:05FromDiscord<mratsim> second, it's a really really tricky part
13:45:22FromDiscord<mratsim> let me find you some Rust inner doc on their v0.3 futures
13:45:59leorizemratsim: after some experimentation I find threads to not cause as much of an overhead in I/O
13:46:01alehander92did they get it right
13:46:22leorizein fact it can be faster than async
13:46:26leorizethroughput-wise
13:46:47leorizespawning a ton of threads come with the cost of virtual memory though (at least on linux)
13:47:00Araqmratsim: as I said, "baking it into the design right away" might amount to "ok, it actually takes two continuations"
13:47:16Araqnot much of a burden
13:48:00alehander92nope, i think threads should be reserved for explicit requests/syscalls/similar
13:48:19alehander92other thing i am wondering is : can one somehow
13:48:22alehander92stop the process
13:48:26alehander92and resume it later
13:48:34alehander92if one can save all the frames
13:48:35alehander92on disk
13:48:38FromDiscord<mratsim> https://github.com/rust-lang/rfcs/blob/master/text/2592-futures.md#rationale-drawbacks-and-alternatives
13:49:28FromDiscord<mratsim> In particular↵> What seems to be perhaps new with this RFC is the idea of melding the "trampoline" technique with an explicit, open-ended task/wakeup model.
13:50:00FromDiscord<mratsim> i.e. we might be able to extend Rust async model with continuations
13:50:54FromDiscord<mratsim> The trick seems to be in the poll method implemented that all futures: https://aturon.github.io/tech/2016/09/07/futures-design/
13:51:02FromDiscord<mratsim> that is an alternative to callbacks
13:51:23FromDiscord<mratsim> > In the demand-driven model, cancellation largely “falls out”. All you have to do is stop polling the future, instead “dropping” it (Rust’s term for destroying the data). And doing so is usually a natural consequence of nested state machines like Join. Futures whose computation requires some special effort to cancel (such as canceling an RPC call) can provide this logic as part of their Drop implementation.
13:52:52alehander92yeah i never really understood the Drop for cancelation concept before
13:55:46*bjornroberg joined #nim
13:58:48FromDiscord<mratsim> it's push vs pull
13:59:21FromDiscord<mratsim> you tell whatever holds the resource (future/socket/ ...) that you are not waiting anymore
14:00:07alehander92i have to read more about it
14:02:32*NimBot joined #nim
14:03:38FromDiscord<mratsim> me too 😛
14:03:52FromDiscord<mratsim> I completely killed the highlighter with emit https://media.discordapp.net/attachments/371759389889003532/716290784294338580/unknown.png
14:11:53Araqmratsim: the problem with the state machine model is that you have 2 dispatch ops, one indirect call for the function handler and inside the function a 'case state of' construct
14:12:37Araqand with continuations you only have one dispatch operation
14:13:31Araqthat seems to be the biggest difference, the rest that Rust does amounts to allocation merging which I think we can do too. I hope
14:14:46Araqfor example in C++ you can use a "small string optimization" for std::function
14:15:18AraqI think we can do the same for our Cont
14:16:28FromDiscord<dom96> So there is really only 1 day until the deadline for NimConf submissions: https://nim-lang.org/blog/2020/05/14/nim-conference.html
14:16:40FromDiscord<dom96> Everyone submitted their talks?
14:20:07alehander92ooo
14:22:15FromGitter<alehander92> praise the Lord, it finally worked
14:22:46FromGitter<alehander92> so my nimvm debugger already gives me breakpoints and next-s and stuff
14:23:17FromDiscord<Recruit_main707> nice
14:23:22FromGitter<alehander92> i should add source rendering + locals introspection + some kind of eval
14:24:04FromGitter<alehander92> and callstack
14:27:04FromDiscord<Recruit_main707> if i create a function by writing its ast in a macro, it can then be used as if it was manually written?
14:27:43FromDiscord<Rika> i dont see why not
14:28:05FromDiscord<Rika> theres no real distinction between a handwritten proc and a macro written proc ain there
14:28:09*crem joined #nim
14:28:14FromDiscord<Recruit_main707> ok
14:28:44FromDiscord<Recruit_main707> it could be interesting to write the flatc-nim tool w/ macros then
14:41:44FromGitter<dawkot> is it safe to ignore gcsafe warnings in asynchttpserver and asynchttpbeast?
14:46:57FromGitter<dawkot> Also why can't I silence it
14:46:58FromGitter<dawkot> ``````
14:47:01FromGitter<dawkot> ```invalid pragma: hint[GcUnsafe2]: off```
14:53:47*Vladar joined #nim
14:59:32Araqisn't it warning[X]:off ?
15:08:58*luis_ quit (Quit: luis_)
15:13:08FromDiscord<mratsim> doesn't really work: https://github.com/nim-lang/Nim/issues/4044
15:13:11disbot{.push hint[XDeclaredButNotUsed]: off.} is not working ; snippet at 12https://play.nim-lang.org/#ix=2nP4
15:13:17FromDiscord<mratsim> this has a workaround but no true fix
15:13:48FromDiscord<mratsim> https://github.com/nim-lang/Nim/issues/11826
15:13:50disbot{.warning[XXX]: off.} doesn't work ; snippet at 12https://play.nim-lang.org/#ix=2nP5
15:13:59*luis_ joined #nim
15:18:42FromDiscord<mratsim> sent a long message, see https://discordapp.com/channels/371759389889003530/371759389889003532/716309618346688572
15:27:43FromGitter<dawkot> Araq, you're right
15:28:09FromGitter<dawkot> ```pragma: hint[GcUnsafe2]: off``` seems to be working
15:28:21FromGitter<dawkot> I mean, ```{.push warning[GcUnsafe2]: off.}```
15:29:28FromGitter<dawkot> Still, is it safe?
15:29:34FromGitter<dawkot> in the case of asynhttpbeast
15:32:40Araqprobably not
15:32:50*rockcavera quit (Remote host closed the connection)
15:38:07FromGitter<dawkot> Jester doesn't show this warning though, I wonder why
15:58:41dadada__hello ladies and gents
15:58:47*dadada__ is now known as dadada
16:00:23FromDiscord<Rika> hello fake (xd) dadada
16:01:23dadadaI tried to optimize the type for a 255 color setting by making it uint8, the result was a lot of ugly code, because I needed to cast it for different abs() and toHex() operations ... in the end with all those casts I'm not sure there's any net positive... by just using int the code becomes simpler
16:01:41dadadabut I might waste some memory, ...
16:02:07FromDiscord<Rika> theres a color module
16:02:18FromDiscord<Rika> https://nim-lang.org/docs/colors.html
16:02:53FromDiscord<Rika> unless you're instantiating billions of these, you're prematurely optimizing
16:03:47dadadaRika: no, only about 255 * 3
16:04:07FromDiscord<Rika> and where are you running this program
16:04:16FromDiscord<Rika> on a computer with kbs of ram?
16:04:19dadadaRika: in my living room :D why do you care :D
16:04:38FromDiscord<Rika> thats not what i mean lmao
16:04:43dadadaI know lmao
16:05:12dadadaRika: my computer has a whopping 16gb of RAM, not bragging :D
16:06:25FromDiscord<Rika> so why are you worried about 3 bytes of ram per color
16:06:26dadadait could make a difference on an embedded device, but only a little one :D
16:06:38*filcuc joined #nim
16:07:03dadadaRika: well, moe wants to replace vi/vim, and they run on embedded devices, too, rightß
16:07:06dadada?
16:07:10dadada:D I probably worry too much
16:07:29FromDiscord<Rika> yeah and 3 bytes aint much is it
16:07:41FromDiscord<Rika> how many colors are you using anyway
16:07:46dadada255
16:07:52FromDiscord<Rika> worry about it when you get to it
16:07:59FromDiscord<Rika> when you encounter issues
16:08:44FromDiscord<Rika> theres prolly some fine line you balance on whether to "solve problems as they come" and "solve problems before they happen"
16:15:34*luis_ quit (Read error: Connection reset by peer)
16:17:44*filcuc quit (Ping timeout: 272 seconds)
16:37:49dadadaRika: true, I think I should solve them before they happen, but this is at the cost of time I could do other things with
16:39:13FromDiscord<Rika> as i said, theres a balance
16:39:35FromDiscord<Rika> if the cost is too big then i guess solve it when it happens
16:46:22*clyybber joined #nim
16:53:32*clyybber quit (Quit: WeeChat 2.8)
16:54:23*clyybber joined #nim
17:02:45*natrys joined #nim
17:06:15*sschwarzer joined #nim
17:13:51FromDiscord<Recruit_main707> after trying a few things i am starting to see some errors with my flatbuffers, fixing a lot and no big issues luckily
17:30:36PrestigeIs there a way to have a proc declared with an optional argument, or should I just use a default value?
17:30:42FromDiscord<codic> can i extract a tar.xz in nim? i want to iterate over each file in archive and only extract it if a certain condition is true
17:31:05FromDiscord<codic> Prestige: why not just accept a table
17:31:15FromDiscord<codic> but that'd be kinda messy
17:31:17Prestigea table?
17:31:23FromDiscord<Recruit_main707> im commiting changes, everyting should be ok now
17:31:39FromDiscord<codic> yeah, a table
17:32:42PrestigeMaybe my wording was unclear - In this particular case I'm wanting this proc to have a string as a param, but the caller of the function could either pass in a string or have the parens be empty like myFunc("something") or myFunc()
17:32:49PrestigeI suppose a default value is fine
17:33:05FromDiscord<Rika> Prestige: proc overloading
17:33:20FromDiscord<codic> ah, then a default value should be fine
17:33:24FromDiscord<Rika> you can just remove the argument in the other proc w/ same name
17:33:27PrestigeYeah thought about that too but is probably more trouble that a default val
17:33:29*konvertex quit (Quit: quit)
17:33:37Prestigethan a*
17:33:43FromDiscord<Rika> depends on the use case i guess
17:33:52PrestigeTrue
17:34:02FromDiscord<codic> ok so time to reask: can i extract a tar.xz in nim? i want to iterate over each file in archive and only extract it if a certain condition is true
17:34:41FromDiscord<Rika> with an archive library sure
17:35:02PrestigeIf there are no libs for it, you could just call `tar` with startProcess or similar
17:36:09zacharycarteror just bind to some C library that can do it
17:38:57sschwarzerPrestige: I think it depends on whether there's a _sensible_ default value.
17:40:21sschwarzerPrestige: That is, not a default value you only come up with to make the argument optional. It shouldn't feel forced.
17:40:37*narimiran joined #nim
17:42:15*filcuc joined #nim
17:45:05*chemist69 quit (Ping timeout: 265 seconds)
17:45:28*chemist69 joined #nim
17:48:02leorize[m]@codic: use nimarchive
17:48:09leorize[m]!repo nimarchive
17:48:11disbothttps://github.com/genotrance/nimarchive -- 9nimarchive: 11libarchive wrapper for Nim 15 11⭐ 0🍴
17:51:37ZevvHey, did Nim ever get this magical float2string implementation integrated?
17:52:31clyybberNope, it exists in our repos
17:52:46clyybberI think leorize has a reimplementation and I have a port
17:53:10clyybberAnd disrtupekt has something in between?
17:54:05ZevvAw, too bad
17:54:12ZevvWhy is this wrong: https://play.nim-lang.org/#ix=2nPI
17:54:28ZevvI am again missing something trivia;
17:54:30Zevvl
17:55:55Zevvit goes away when I use 'untyped' in the macro
17:57:26leorize[m]well if you ever want to work on ryu, look at go
17:57:28disruptekgive your macro a return value.
17:58:16leorize[m]they're doing some pretty nice reimplementation work with a lot of analysis
17:58:22leorize[m]we can learn a few things or two from them
17:58:38disruptekwhy don't you port it if you aren't going to continue your impl?
17:59:11disruptek!repo yourang
17:59:12disbothttps://github.com/disruptek/yourang -- 9yourang: 11Thread-safe performant async I/O for Linux 15 6⭐ 0🍴
17:59:23disruptekZevv: for your cps i/o benchmarks.
17:59:35disruptekmostly unimplemented, of course.
18:01:26*Vladar quit (Quit: Leaving)
18:01:37*filcuc quit (Ping timeout: 246 seconds)
18:03:33FromDiscord<codic> does nimarchive support this?↵> i want to iterate over each file in archive and only extract it if a certain condition is true
18:04:11FromDiscord<codic> and tar with startprocess is what im doing rn but for the above, i need to scrape the text, and the output could change at any time, which would actually literally wipe the whole system
18:20:46Zevvdisruptek: much appreciated
18:20:50Zevvbut for now there is only hurt
18:20:52Zevvit hurts so much
18:21:22disruptekc'mon, it's not that hard.
18:21:29Zevvdude
18:21:57ZevvI did make My First Transform just now, tho
18:22:02Zevvwith cheating on the lambda lifting
18:22:40clyybberthere can be no progress without struggle
18:23:23clyybberif you struggle hard, you'll progress hard :D
18:23:34*fredrikhr quit (Ping timeout: 265 seconds)
18:24:40Zevvsure, sure
18:24:43Zevvbut still
18:25:13ZevvI wonder how this happend. My plan was to complain so the nice coroutines would just appear by magic
18:25:23disrupteki thought all you have to do is write a macro.
18:25:34Zevvtrue, true
18:25:41Zevvon it!
18:25:52Zevvhttps://github.com/zevv/nimcsp/blob/master/xfrm.nim
18:26:48disruptekit'll be one of three things that make nim the language to beat.
18:26:58Zevvthe others being?
18:27:06disruptekshhh
18:27:44Zevvˢˢˢʰ
18:43:48*dadada quit (Ping timeout: 256 seconds)
18:45:27*dadada joined #nim
18:45:49*dadada is now known as Guest31416
18:45:53FromDiscord<Rika> so when are you renaming the repo to cps like it is on the readme
18:45:54*narimiran quit (Ping timeout: 240 seconds)
18:46:19*waleee-cl joined #nim
18:57:56Zevvwhen it works, not before
18:58:01Zevvthe name is just as wrong as the code
19:00:08Zevvwell well, I can run my first - absolutely trivial - tasks
19:00:16*narimiran joined #nim
19:00:30Zevvwith some stuff hardcoded. I have no clue how to do lambda lifting yet
19:01:07ZevvT-00:21
19:09:38*Guest31416 quit (Ping timeout: 256 seconds)
19:10:30FromDiscord<Intexisty> how would i make a constructor for my class
19:11:12ZevvThere is no such thing in Nim - idiom is to make a `newThing(...): Thing` proc for that
19:12:12FromGitter<zetashift> I don't know much about concurrency except for dabbling with Elixir, what is the difference between nimcsp/coro and Weave?
19:12:42ZevvWeave is a thread pool implementation, mratsim style
19:12:56Zevvi.e.: 150% optimized and efficient
19:13:31FromGitter<zetashift> So Weave is like a runtime and you could say nimcsp is an implementation of how to (easily) program concurrently?
19:13:37FromGitter<zetashift> Everything mratsim style is :D
19:14:23Zevvnimcsp is just me toying around with some CS theories - the idea is that code can be transformed so it does exactly the same thing, but does not need a stack.
19:14:36ZevvEffectively it chops functions up in smaller pieces which get "chained"
19:15:15Zevvbut you can play with the program flow and run snippets in any order, so tie it up to event queues, use it for "concurrent" code flow, or implement iterators
19:15:28*dadada__ joined #nim
19:15:52*zacharycarter quit (Ping timeout: 256 seconds)
19:16:01Zevvbut I'm not sure if I will get there eventually, it's just an experiment
19:16:09FromDiscord<Intexisty> so can i just do
19:16:16FromGitter<zetashift> How is the chopping up of functions and chaining them not a stack with smaller elements?
19:16:40FromDiscord<Intexisty> ```nim↵method x_new(this: x) = ↵```
19:16:54FromDiscord<Intexisty> wait no
19:17:09FromDiscord<KrispPurg> use proc
19:17:15FromDiscord<Recruit_main707> or func
19:17:30Zevvzetashift: the call flow and local variables do not go on the stack. These are stored in small objects ("continuations") which say "sometime in the future, call this function with these arguments"
19:18:02ZevvYou can call them all in a row and then would run just as before the transform, but you could also run them in any order you like
19:18:20Zevvyou could programmatically make custom program flow constructs without needing support from the language or compiler
19:18:20FromDiscord<Intexisty> i got it
19:18:34FromDiscord<Recruit_main707> sent a code paste, see http://ix.io/2nPY
19:18:38FromDiscord<Intexisty> ok
19:19:43FromDiscord<KrispPurg> I have never seen a constructor in Nim using func instead.
19:20:04Zevvwell, it's not wrong :)
19:20:16FromDiscord<Rika> thats prolly because some people arent aware
19:20:25FromDiscord<Recruit_main707> if possible use func right? so i use func :)
19:21:39FromDiscord<KrispPurg> I like proc, but func is proc too.
19:21:45sschwarzerIs there a syntax to set a field in a object type definition to a default? I get "initialization not allowed here". It's not super-important because I can set the field in the `init...` proc, but I'm still curious if there is a syntax to define a default value.
19:22:35FromDiscord<Generic> there is none
19:22:37FromDiscord<Rika> no
19:22:44FromDiscord<Generic> though there has been some debate about this
19:22:48FromDiscord<Rika> use the init proc as much as possible, i guess
19:22:59sschwarzerThanks everyone :)
19:23:00Zevv*BOOM*
19:23:12FromDiscord<Rika> though i think we should be able to override default(typedesc[AType])
19:23:48FromDiscord<Generic> https://github.com/nim-lang/RFCs/issues/48
19:23:51disbot[RFC] Another proposal for a standardized object construction/initialization. ; snippet at 12https://play.nim-lang.org/#ix=2nQ2
19:28:14FromGitter<zetashift> I usually use func for those constructor type functions too
19:37:48sschwarzerGeneric: The RFC seems to be stalled. :-/
19:38:03sschwarzerzetashift: yes, why not :)
19:38:32sschwarzerzetashift: just looked at my code and saw that I also use `func` there. :)
19:38:46sschwarzerfor the "constructors"
19:39:27*dadada__ quit (Ping timeout: 265 seconds)
19:42:00sschwarzerIt looks there's no way to send private messages via the Nim forum software, right? (Not having this _may_ even be considered a feature to avoid spam, but still.)
19:42:07Yardanicosschwarzer: yeah
19:45:27*dadada joined #nim
19:45:49*haxscramper joined #nim
19:45:50*dadada is now known as Guest40129
19:47:13FromDiscord<Generic> I have a pretty complex macro which produces almost C++ like compile times
19:47:45FromDiscord<Generic> should I cache it's result to file?
19:48:18FromDiscord<Rika> if it doesnt change often, yes
19:48:28FromDiscord<Generic> it doesn't change often
19:48:31FromDiscord<Rika> then delegate the "generation" to a define
19:48:37FromDiscord<Rika> like -d:generateXXXXXX
19:48:39FromDiscord<Rika> or something
19:48:42FromDiscord<Rika> thats what i did once
19:48:50FromDiscord<Generic> oh thank you for that idea
19:49:05FromDiscord<Generic> you saved me from writing some kind of complex caching mechanism
19:49:32haxscramperI'm writing macro will provide relatively complex DSL with several operators that should be availiable only inside of a macro. Right now I see two options for implementing such macro: (1) take `body` AST and rewrite it, replacing operators with code /or/ (2) declare template/proc inside of a macro. Which one would you recommend?
19:49:34FromDiscord<Rika> you should know of the caveats
19:49:45FromDiscord<Rika> "forgetting to run the generate define when it does change" or something
19:50:08FromDiscord<Generic> it's still better than the way this is done usually
19:50:20disruptekhaxscramper: (1)
19:50:27FromDiscord<Generic> it's a dispatcher for an the interpreter of an emulator
19:51:03FromDiscord<Rika> haxscramper: 1 imo also
19:51:27FromDiscord<Generic> I basically have one proc which fills in a const structure where I specify all the encodings and a second one to dispatch based on that generated const
19:52:23FromDiscord<Generic> for haxscramper why not 2?
19:52:43FromDiscord<Generic> it could be a lot easier to implement
19:52:47FromDiscord<Rika> more efficient on run for 1
19:53:02FromDiscord<Rika> i dont think templates would work in macros
19:53:15FromDiscord<Generic> the templates would be inside the generated code
19:53:24FromDiscord<Generic> that's atleast how I understood it
19:54:02haxscramperThat's correct. Right now I have test implementation that defines `iterator` inside of a macro - it works as expected.
19:54:17FromDiscord<Rika> iterator and proc would work
19:54:22FromDiscord<Rika> but i dont think templates do
19:57:14*zacharycarter joined #nim
19:58:15haxscramperFirst option seems easier to implement and has less possible edge cases (like templates in macros) so I will try to use AST rewriting. There is `krux02/ast-pattern-matching` which looks like exactly what I need for this sort of task. Thanks for feedback.
19:58:43FromDiscord<Rika> 2nd actually sounds easier to implement
19:58:46FromDiscord<Rika> but yeah
19:59:56*natrys quit (Quit: natrys)
20:01:02*narimiran quit (Ping timeout: 258 seconds)
20:01:51*clyybber quit (Quit: WeeChat 2.8)
20:02:03*gangstacat quit (Quit: Ĝis!)
20:03:36*gangstacat joined #nim
20:08:21*haxscramper quit (Remote host closed the connection)
20:18:01*drewr joined #nim
20:23:39*Trustable joined #nim
20:26:38*zacharycarter quit (Ping timeout: 272 seconds)
20:37:49FromDiscord<Recruit_main707> my flatc-nim tool already parses and creates structs and enums 😁, getters and setters which will probably the hard ones are not done yet though.
20:37:53FromDiscord<Recruit_main707> and tables...
20:42:40FromGitter<JohnAD> Hey all. I'm hoping to have my `jesterwithplugins` library (by arrangement with Dom96) followed by four plugin library up on *nimble.directory* long before the Nim conference. Is there a best person to contact about moving it along or making needed changes? The PR (#1491) is only two days old; so I would normally wait; but the conference is 7 days from now. Is there a recomemnded person to chat with?
20:42:41disbothttps://github.com/nim-lang/Nim/issues/1491 -- 5Almost all examples compiled with Visual C++ 2013 crash on startup
20:44:35Yardanico@JohnAD nimble.directory is updated automatically
20:44:52Yardanicothe creator of nimble.directory is federico3
20:46:25*zacharycarter joined #nim
20:46:28*tdc quit (Ping timeout: 246 seconds)
20:47:17dom96hm? The conference isn't 7 days away AFAIK
20:47:21Yardanicoyeah
20:47:25Yardanicoit's 20 days away :P
20:48:55FromGitter<JohnAD> @Yardanico . Nice; I did not know that. So, once the PR is merged the rest happens automatically?
20:50:40Yardanicoyes of course
20:50:45Yardanicohttps://nimble.directory/ is fully automated
20:50:52Yardanicosrc is in https://github.com/FedericoCeratto/nim-package-directory
20:50:54FromGitter<JohnAD> Oh, I'd better fix my calendar :) . ..just looked it up... June 20th. In that case, I'll not worry about it.
20:51:06dom96What PR are you referring to?
20:51:17dom96PRs adding the packages to our central repo?
20:51:20dom96PRs fixing Nim?
20:51:24FromGitter<JohnAD> https://github.com/nim-lang/packages/pull/1491
20:51:25disbotAdd package jesterwithplugins
20:51:28dom96PRs fixing nimble.directory?
20:51:41dom96Okay, I got confused by disbot
20:51:51dom96then yes, it's all automatic
20:52:36FromGitter<alehander92> disruptek
20:52:49FromGitter<alehander92> i started a macro/vm debugger
20:52:53FromGitter<alehander92> yay me
20:53:05FromGitter<alehander92> oh man nimconf is on my birthday
20:53:23FromGitter<alehander92> i'll spam some stuff in the comments probably
20:53:51FromGitter<alehander92> awesome zevv
20:53:59FromGitter<alehander92> would love to play with it next week
20:59:50leorize[m]disruptek: well I'm having a lot on my hands
21:00:14Zevvalehander92: well, not too much to play with yet, it's fragile and full of hardcoded stuff
21:05:17*Jesin quit (Quit: Leaving)
21:08:28*Jesin joined #nim
21:10:12sschwarzeralehander: re nimconf being on your birthday: is that good or bad? Or both? :)
21:11:42*idf quit (Ping timeout: 256 seconds)
21:13:49*Trustable quit (Remote host closed the connection)
21:16:16FromGitter<alehander92> i am not sure :D
21:16:27FromGitter<alehander92> zevv completely normal
21:16:35FromGitter<alehander92> disruptek the rocket guys
21:16:39FromGitter<alehander92> managed to fly gg!
21:18:38dom96Am I missing context or is disruptek responding to you on stream?
21:22:54*solitudesf quit (Ping timeout: 260 seconds)
21:23:46*sacredfrog quit (Quit: ZNC 1.8.0 - https://znc.in)
21:29:19FromGitter<alehander92> i am just spamming him, because i watched the first rocket stream there, sorry
21:29:40FromGitter<alehander92> i just talk without context in real life
21:30:11dom96If you're talking to him on stream then you should do that in a separate dedicated twitch channel or at least in offtopic
21:30:54disrupteklook, mom, he's not in offtopic or on a stream.
21:30:56disruptekchrist.
21:31:07disruptekrocketry is pretty fucking sexy, i have to admit.
21:31:22disruptekbut i will never work for musk. the guy is an asshole.
21:32:01livcdproud american!
21:32:08ZevvI've spent too much of my life doing KSP
21:32:12disruptektomato, tomatoe.
21:32:19ZevvJebediah sais hi
21:32:37FromGitter<alehander92> sorry dom96 i didnt watch stream today
21:32:46FromGitter<alehander92> but the conversation was still pretty offtopic indeed
21:33:17disrupteksshhhh, dom wants to talk about something nim-related.
21:33:28FromGitter<alehander92> well, I agree that worklife balance seems not good in spacex, but i guess this is typical for many SV-style companies
21:33:36FromGitter<alehander92> slash startups
21:33:59FromGitter<alehander92> its probably like game companies: you're passionate about X, so lets work that 60 hours
21:35:01FromGitter<JohnAD> @dom96. If you have a few moments to discuss. What was the use-case for the `before` and `after` directives in a jester router? Because of the macro-created blocks, it can only change globals or already existing vars in the context of the thread (such as request). So, it's goal has been eluding me.
21:36:28FromGitter<alehander92> oh sorry i skip messages
21:38:47dom96JohnAD: honestly it's been likely directly copied from Sinatra
21:39:29dom96but one use case might be calling authReq in a `before` block
21:39:37dom96which I guess your plugins solve slightly differently
21:39:38dom96bbl
21:41:27alehander92what is happening with jester btw
21:41:45alehander92is it becoming more rails-like
21:42:47alehander92with that plugins addition i mean
21:43:44disruptek!repo disruptek/gram
21:43:45disbothttps://github.com/disruptek/gram -- 9gram: 11Generic graphs in Nim 15 2⭐ 0🍴
21:43:57disruptek^ demonstrates arc bug; run gram.nim
21:45:17sschwarzerJust checking ... I think I read that you can use Nim iterators only in for loops, right? Or can I get hold of an "iterator object" as in Python?
21:45:30disrupteksee closure iterators.
21:49:13AvatarfighterIs there a max recursive depth in nim?
21:49:21disruptekaround 2000
21:49:45AvatarfighterOk yeah that matches to about what I'm seeing
21:49:47YardanicoAvatarfighter: by default it's 2k
21:49:48disruptekyou can override it, but... why
21:49:49Yardanicoyou can change it
21:49:51Yardanicoyeah
21:50:08sschwarzerdisruptek: Hm, I need to think about how this might help. Another approach could be to get hold of an object with an `items` method that I can use in a `for` loop.
21:50:13AvatarfighterI'm having a slight issue with my webscraper bc of some recursive shenanigans
21:50:27Yardanicowhy too much recursion though
21:51:04AvatarfighterI'm not entirely sure yet, I'm messing with an ungcsafe async callback
21:53:00sschwarzerI'm still on the XML tree iterator with in-place changes and am thinking about a better _and_ more robust API. At the moment I think it's a brittle idea to let client code manipulate the tree (deletions/insertions) in the loop body. I'm rather thinking now of "methods" on an iterator or similar object, so that the iterator gets "notified" of the tree manipulations.
21:53:59AvatarfighterWhat are you working on sschwarzer?
21:54:04AvatarfighterSounds interesting !
21:54:18sschwarzerAt the moment I'm working with the approach that I can/could call methods on the individual items "returned" by the loop/iterator.
21:54:38bunghe want something like cheerio in js
21:54:51disruptekeh nah
21:54:57sschwarzerAvatarfighter: https://forum.nim-lang.org/t/5697 , especially https://forum.nim-lang.org/t/5697#39423
21:56:30Avatarfightersschwarzer: That sounds like a super interesting project :)
21:57:55sschwarzerAvatarfighter: thanks for the encouragement, I need it. :) It started with a smaller problem (that I have solved), cleaning up an XML tree. Than in the forum, someone (I think cblake) had the idea to generalize it and encouraged me. :-)
21:58:14sschwarzerI'm actually relatively new to Nim, but the language is super-interesting.
21:59:24AvatarfighterI'm loving the language, I'm pretty bad with how efficient my programs are and I usually need to be spoonfed help but this language is one of the few with friendly, helpful people and not a toxic cult like other languages
21:59:37disruptekgive it time.
22:00:08Zevvyeah, you wait and we'll dissapoint you
22:01:53Avatarfighterlmao
22:02:03AvatarfighterNah no way I'll get disappointed
22:02:22sschwarzerWhat I particularly like is the decoupling of objects/types and the operations on them (supported by argument overloading). That's a really awesome desig feature.
22:02:35sschwarzer*design
22:02:41AvatarfighterI really enjoy the ffi
22:02:49ZevvI enjoy the toxic cult
22:03:58Avatarfighterhaha
22:06:47sschwarzerZevv *lol*
22:10:48AvatarfighterThe only cult im in is the Loving Araq Cult
22:11:48alehander92no need to be in a cult
22:11:51alehander92to love
22:12:03alehander92open your heartszz
22:12:46Zevvclosing my eyes
22:19:29FromDiscord<Generic> has someone ever thought of jitting nimscript?
22:24:01sschwarzerGeneric: Maybe. But usually you don't write long-running programs in Nimscript, so it may not pay off that much. On the other hand, if Nimscript was faster, maybe people would use it more? :)
22:25:15FromDiscord<Generic> yeah, most of the time macros stay relatively small
22:25:43FromDiscord<Generic> though I'm not the first one to make a macro where compile times become an issue
22:26:23FromDiscord<Generic> those resources are probably better spent with incremental compilation anyway
22:27:28*zacharycarter quit (Ping timeout: 256 seconds)
22:32:06bunghttps://play.nim-lang.org/#ix=2nSF these do same work as stream lib' `write` ?
22:35:12disruptekgeneric: how slow are we talking?
22:35:33disruptekwe were just talking about how useless incremental compilation is.
22:35:53FromDiscord<Generic> so slow that incremental compilation will probably make a difference
22:36:01FromDiscord<Generic> wait a moment I'll use a stop watch
22:36:27disruptektalk to me when you have a macro that takes ~2min.
22:37:08disruptekanyway, macros are in general a more significant challenge for ic.
22:38:19FromDiscord<Generic> interestingly it's only nim check which is so slow
22:38:26FromDiscord<Generic> the nim compiler is super fast
22:39:15FromDiscord<Recruit_main707> Hey, I have a question, would someone like/want to collaborate on getting Nim flatbuffers into the google repo and on the process make them much more usable?↵The thing is that the implementation it’s finished, but the code generator is crucial (with docs and tests, but that’s easy), and it should be done in c++ using their “library” or tooling system.
22:40:55FromDiscord<Recruit_main707> I have on c++ experience, and although I might be able to get something working, it is probably a better idea to have it done by a c++ programmer
22:41:09FromDiscord<Recruit_main707> I have no*
22:41:43FromDiscord<Generic> I think I know what the real bottleneck is!
22:41:54*neceve quit (Ping timeout: 240 seconds)
22:42:03FromDiscord<Generic> my code currently produces quite a lot of errors
22:42:19FromDiscord<Generic> I think it's vscode nim's diagnostics parser which is the so slow
22:43:06FromDiscord<Generic> @Recruit_main707 that sounds stupid
22:43:31FromDiscord<Generic> like they have never heared of macros 😉
22:43:51FromDiscord<Recruit_main707> What part sounds stupid
22:44:12FromDiscord<Generic> that the code generator needs to be written in C++ and that it's an external program
22:44:42FromDiscord<Generic> in Nim you could just have a macro which spits the code out
22:45:18FromDiscord<Recruit_main707> Yeah, but if we want nim to be in there, it needs to be done that way
22:45:44FromDiscord<Recruit_main707> I know macros would be the “ideal” solution
22:46:00*mwbrown quit (Quit: Exiting)
22:46:13FromDiscord<exelotl> vscode nim plugin works like 10% of the time for me 😅
22:47:06disruptekyou can lead whores to water, but you can't make them drink.
22:48:05FromDiscord<exelotl> I see like 10% of what you did there
22:48:42disruptekuse macros. if they don't like it, it's tough titties.
22:49:45bungnimsuggest have problems while you using nested templates or `{.dirty.}`
22:50:03FromDiscord<Generic> I experienced that as well
22:50:12FromDiscord<Generic> it also doesn't like recursive imports
22:51:19bungI think it mainly related to the vm.nim, I know where it is, but am not able to fix
22:54:03voltistSeeing as shashlick doesn't seem to be around at the moment, does anyone else have enough experience with nimterop for me to get some help?
22:57:42*mwbrown joined #nim
23:07:16FromDiscord<codic> Going to rephrase my old question to this: Is it possible to do something like this with pure nim? https://hastebin.com/fapujixiyu.bash
23:07:48*xet7 joined #nim
23:07:53*sschwarzer quit (Quit: leaving)
23:10:07bungcodic you just need check nim's zip lib
23:11:26bungI can tell you it is possible, and basiclly just replace your proc call to zip lib api.
23:11:44*xet7 quit (Remote host closed the connection)
23:21:29FromDiscord<Recruit_main707> disruptek, but as they said, having nim in that repo is worth the “sacrifice”
23:26:43*Faulander_ joined #nim
23:26:44*Faulander quit (Read error: Connection reset by peer)
23:27:53FromDiscord<codic> zip library supports .tar.xz?
23:28:05FromDiscord<Elegant Beef> Should support tarballs
23:28:20FromDiscord<codic> nice, where are the docs?
23:28:35FromDiscord<Elegant Beef> Not a clue
23:28:38FromDiscord<Elegant Beef> I use nimarchive
23:28:45FromDiscord<codic> oh here, https://nimble.directory/docs/zip
23:28:56FromDiscord<codic> I'd be happy to use nimarchive but does it have that functionality?
23:29:01FromDiscord<codic> something like https://hastebin.com/fapujixiyu.bash
23:29:05Avatarfighterquick question, do I still need to await my async procs even if I have a loop constantly polling ?
23:29:21YardanicoAvatarfighter: depends on what you mean exactly
23:29:28FromDiscord<codic> aaaah there isn't a xz section in https://nimble.directory/docs/zip welp
23:29:36Yardanicoif you want to _continue_ but still run the async proc you need to do asyncCheck mycall()
23:29:43Yardanicoif you want to _wait_ until a future complets you use 'await"
23:29:59Yardanico@codic what about https://github.com/genotrance/nimarchive
23:30:26FromDiscord<codic> It doesn't seem to have the functionality I asked for :\
23:30:31Yardanicowhy?
23:30:35Yardanicolibarchive has lzma and tar support
23:30:40Yardanicoand nimarchive just wraps libarchive
23:30:45Yardanicohttps://github.com/libarchive/libarchive
23:30:47FromDiscord<codic> it doesn't allow me to loop thru each file in the archive
23:31:12FromDiscord<codic> and only extract if a condition passes↵at least from what i can cee
23:31:14FromDiscord<codic> (edit) 'cee' => 'see'
23:31:36AvatarfighterYardanico: I ask because Leorize helped me and we were able to create futures and get them to resolve without actually awaiting/asyncChecking them via a while loop that endless polled so I was curious to know if that was meant to work lol
23:31:55YardanicoAvatarfighter: I don't really understand what you mean :)
23:32:08Yardanicoyou can create and get futures, yes, but you should never do "discard asyncCall()"
23:32:23Yardanicoif you do something like "let fut = myFut(); if fut.failed: print error else: get data" then it's ok
23:32:37AvatarfighterWait let me copy what I meant
23:33:18Avatarfighterhttps://play.nim-lang.org/#ix=2nSY "startTask" is an async proc leorize and I were able to get those procs to resolve without doing anything to them and I'm trying to understand why
23:33:39Prestigedom96: how reliable is nimbox for an actual application?
23:34:50YardanicoAvatarfighter: well the first thing I see is that you don't handle errors at all
23:34:54Yardanicounless you do it in startTask
23:35:05AvatarfighterI do in startTask :) haha
23:35:09Yardanicobut yeah mostly it's fine, although your queueLoop doesn't need to be async then
23:35:23Yardanicoalso I see why it's recursion limit
23:35:43Avatarfighteryeah that's why I asked earlier about recursion limits in nim haha :D
23:35:49bjornrobergcodic: Isn't this something that might be what you want? https://github.com/libarchive/libarchive/wiki/Examples#list-contents-of-archive-with-custom-read-functions
23:35:54Yardanicoeach async proc is like 3-7 calls
23:36:01Yardanicobecause of all iterators and stuff which is made by the async macro
23:36:02FromDiscord<codic> Wait what, let me take a look at that
23:36:18FromDiscord<codic> That does seem like what I want, but it's c which i don't know
23:36:38FromDiscord<codic> So I wouldn't know how it'd look in nim
23:36:48Yardanicoyou can write c-like nim :P
23:37:00FromDiscord<codic> There should be an idiomatic way to do it though
23:37:33FromDiscord<codic> :\
23:38:09FromDiscord<codic> I see callbacks https://genotrance.github.io/nimarchive/nimarchive/archive.html#archive_read_open%2Cptr.archive%2Cpointer%2Cptr.archive_open_callback%2Cptr.archive_read_callback%2Cptr.archive_close_callback but not sure how to use
23:38:39leorize[m]use them like how you would in c :p
23:39:17Yardanico@codic well it's all about abstractions and wrapping c-style things in nim-style things
23:40:15AvatarfighterIn theory when I create a future I should just be able to resolve it via a poll() right?
23:40:46Yardanicowdym "resolve"
23:40:56Yardanicowith poll you just run all tasks in the dispatcher
23:41:18Avatarfightersorry when I say resolve I mean run
23:41:25Yardanicowell you can just do
23:41:30Yardanicowhile hasPendingOperations(): poll()
23:41:46FromDiscord<codic> But I don't *get* how it works in C
23:41:49Yardanicoand remove async from queueLoop - that proc isn't async
23:42:00Yardanico@codic you just create a nim proc
23:42:09Yardanicothen pass addr myproc to this proc
23:42:17Yardanicoit's quite easy to understand, no?
23:43:04FromDiscord<codic> that's easy to understand, what isn't is the content of the proc. like, how do i port the structs, malloc, `->`, etc? could you give a quick example?
23:44:26Yardanicoyou just create an object
23:44:31bjornrobergcodic: there's an example in the test for nimarchive https://github.com/genotrance/nimarchive/blob/master/tests/tnimarchive.nim
23:44:45*lritter joined #nim
23:44:56FromDiscord<codic> that's doing it manually?
23:45:01Yardanico"->" is field access, in nim it's .
23:45:08Yardanicomalloc is not needed in nim usually since nim allocates memory for you
23:45:50bjornrobergvar arch = archive_read_new() # does a malloc in the background (or similar)
23:45:57FromDiscord<codic> so in https://github.com/genotrance/nimarchive/blob/master/tests/tnimarchive.nim, where are they actually extracting the file?
23:46:34Yardanicothey're not extracting it, they're reading it
23:46:37bjornrobergno, in that test there's simply assertions that the content is correct
23:47:04bjornrobergyes, what Yardanico said :)
23:47:43bung`z.open(filename, fmRead);let outStream = newStringStream("");z.extractFile("foo.bar", outStream)`
23:48:10bjornrobergalso, seems like there's a utility: extract("tests/nimarchive.7z", "destDir")
23:48:33bungI guess you just need do it with nim's zip lib
23:49:12bungor `z.extractAll("files/td")` extractAll file to a dir
23:49:19Yardanicobung: he wants to check files in the archive
23:49:26Yardanicoand based on that extract or something
23:51:29bungoh it's `zip_fopen(z.w, filename, 0'i32)`