00:00:08Yardanicohttps://i.imgur.com/wiAMMqK.png :P
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:07codicah ok
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: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: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: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: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: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: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: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: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:15FromDiscord<codic> ah
01:13:16FromDiscord<codic> ok
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: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:52Yardanicoin ~/.nimble/toolchains somewhere
01:21:57Yardanicoor ~/.choosenim idk
01:22:19FromDiscord<codic> rm -rf .{choosenim,nimble}
01:22:20FromDiscord<codic> there
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: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:30zacharycartercome be a disgruntled python developer with me
03:59:56disruptekit's austin, right?
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:02:26disruptekis that a real photo of the pen?
04:02:29disruptekthe bullpen?
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: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: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: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: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: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:19:38*narimiran quit (Quit: leaving)
06:22:54*solitudesf joined #nim
06:32:47leorizegot 404
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: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: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: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: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: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: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: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: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: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: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:59alehander92how is it
10:30:18alehander92how is the game going?
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: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:22ZevvWell, that will be one of the end results
10:34:32Zevvbut we will also replace iterators and closure iterators
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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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:30disbot12https://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: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: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: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: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: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: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: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: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: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➥ 5{.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➥ 5{.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: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: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"