<< 07-08-2020 >>

00:05:54*audiofile joined #nim
00:32:49*endragor joined #nim
00:37:05*endragor quit (Ping timeout: 240 seconds)
00:55:28*maier joined #nim
01:00:11*maier quit (Ping timeout: 240 seconds)
01:04:05*apahl_ joined #nim
01:06:45*apahl quit (Ping timeout: 240 seconds)
01:35:09FromDiscord<Varriount> shashlick: As much as I would prefer a pure-nim version, I can see tree-sitter being useful for creating utilities such as linters and formatters
01:45:56*endragor joined #nim
01:53:03*Tlongir joined #nim
02:03:15shashlickWhy pure Nim?
02:03:45disruptekbecause otherwise there's nothing to bikeshed.
02:04:28disruptekthere's too many users of treesitter. too much support. too much momentum and future development.
02:04:33*JStoker quit (Read error: Connection reset by peer)
02:04:56disruptekbetter to have one person write a replacement, from scratch, and maintain it.
02:25:39leorizedisruptek: I don't know that much about cpp symbol mangling
02:26:09shashlickI'll never get porting c/c++ to Nim
02:26:39shashlickIt's one thing to think that way with an incompatible language
02:27:06shashlickI think we need to start contributing more precompiled libraries to the world
02:27:38shashlickSo ruby or Julia folks can benefit from our innovation for example
02:29:38*JStoker joined #nim
02:38:46*audiofile quit (Quit: Default Quit Message)
02:46:10*endragor quit (Remote host closed the connection)
02:46:19*endragor joined #nim
02:56:33*maier joined #nim
03:01:10*maier quit (Ping timeout: 256 seconds)
03:29:36FromDiscord<Varriount> @shashlick I think the biggest reason is just annoyance at having to deal with building C/C++
03:31:24FromDiscord<Varriount> That being said, my experience with Linux is that build problems are largely self inflicted (because of distro choice, manually moving files around, etc).
03:32:36FromDiscord<Varriount> On Windows it's a headache, because of headaches with CMake, Autotools, or Visual Studio Projects.
03:32:51FromDiscord<Varriount> (edit) "a headache," => "harder,"
03:33:22shashlicki can totally relate
03:33:34shashlickinitially i added cmake and co support to nimterop
03:33:58shashlicknow with JBB and Conan support, it's a lot easier to get precompiled binaries cross platform without wrestling with distros and windows
03:34:07FromDiscord<Varriount> JBB?
03:34:21shashlickhttp://BinaryBuilder.org run by Julia folks
03:34:37shashlicknimterop can download precompiled binaries from there
03:34:55FromDiscord<Varriount> Oh, wow.
03:35:10shashlicksee nimarchive and nimgit2 for examples
03:35:25FromDiscord<Varriount> Where was this when I was struggling to build 64-bit GTK on Windows?
03:36:34FromDiscord<Varriount> (GTK is all the fun of a project only developed on Linux, combined with the teeth-grinding annoyance of circular dependencies)
03:37:22shashlick๐Ÿ˜„
03:37:45shashlickhttps://github.com/JuliaBinaryWrappers/GTK3_jll.jl/releases
03:38:31leorize@Varriount if you're on windows then just use msys2-mingw-w64?
03:39:00leorizeif you use their package management system it can even solve deps and bundle all of them up nicely for you
03:40:21FromDiscord<Varriount> leorize: Sure, I'll just have to travel back in time 8 years
03:40:52shashlickproblem with msys is too many deps
03:41:06shashlicki would have added nimterop support to download those but ya
03:41:18FromDiscord<Varriount> Also, https://devblogs.microsoft.com/oldnewthing/20140411-00/?p=1273
03:45:31shashlickso @Varriount did you see cExclude()?
03:48:20leorize@Varriount ?
03:48:44FromDiscord<Varriount> @shashlick I believe I saw it mentioned in a reecent image.
03:48:48FromDiscord<Varriount> recent issue
03:49:00leorizeshashlick: jbb's binaries also have deps :P
03:49:10FromDiscord<Varriount> in the Nimterop repo. I was perusing the issue tracker a couple of hours ago.
03:56:22shashlick@Varriount i was asking in reference to the python dsl work you did - anyway, looking forward to your feedback
03:56:43shashlick@leorize - yes but it also depends on msys libraries - forget the names now
04:05:31*waleee-cl quit (Quit: Connection closed for inactivity)
04:06:01*supakeen quit (Quit: WeeChat 2.8)
04:06:46*supakeen joined #nim
04:38:04*narimiran joined #nim
04:56:57*maier joined #nim
05:02:18*maier quit (Ping timeout: 260 seconds)
05:07:30*maier joined #nim
05:11:08*vicfred quit (Quit: Leaving)
05:34:39*rockcavera quit (Remote host closed the connection)
05:43:02*solitudesf joined #nim
05:53:47FromGitter<codenoid> hello nim folks, stay alive
05:53:54supakeenHi.
06:02:43*Tlongir quit (Remote host closed the connection)
06:05:33*Romanson joined #nim
06:16:49*letto quit (Quit: Konversation terminated!)
06:18:18*lritter joined #nim
06:22:35*letto joined #nim
06:27:58*NimBot joined #nim
06:32:16*Vladar joined #nim
06:39:41*PMunch joined #nim
06:46:38FromDiscord<creatable> `GetWindowThreadProcessId()` does not return the correct process ID and I'm not exactly sure why
06:48:00FromDiscord<creatable> sent a code paste, see https://play.nim-lang.org/#ix=2ttV
06:55:25PMunchSure it's not this you want to do? https://play.nim-lang.org/#ix=2ttY
06:55:30PMunchBased on your C++ example
06:58:22FromDiscord<creatable> that is exactly what i want to do :^)
06:58:30FromDiscord<creatable> nim feels weird to me, i guess i'm too used to python
06:58:49FromDiscord<creatable> quirks like this is exactly why i'm writing this in the first place, to get used to things
07:01:14FromDiscord<Varriount> @creatable Well, it's not so much how Nim works, as how C functions work
07:01:22FromDiscord<mattrb> Hey! I'm pretty new to Nim. How can I make the compiler happy here? https://play.nim-lang.org/
07:01:41FromDiscord<creatable> yeah, i lack experience in things outside of python and js to be honest
07:01:55FromDiscord<Varriount> @mattrb That's a blank link
07:01:59FromDiscord<creatable> it'd probably be better to learn c / cpp first, but this is the easy route lol
07:02:16FromDiscord<mattrb> Lol https://play.nim-lang.org/#ix=2tu1
07:02:18FromDiscord<mattrb> Whoops
07:02:34FromDiscord<mattrb> I'm also new to sharing links apparently
07:02:53FromDiscord<Varriount> What error are you getting?
07:04:31FromDiscord<creatable> that worked :D
07:04:47FromDiscord<mattrb> Sorry, I phrased my question poorly. The error message says to replace `addr` with `unsafeAddr`, but I'm more just wondering what the semantic difference is
07:05:21PMunchAh
07:06:04FromDiscord<mattrb> I see the different description in the docs here https://nim-lang.org/docs/system.htmlโ†ตWhat makes these fundamentally different to deserve a different method?
07:06:04FromDiscord<Varriount> @mattrb In Nim, parameters aren't guaranteed to have an address
07:06:38FromDiscord<Varriount> Or rather, a writeable
07:06:48FromDiscord<Varriount> writeable address
07:06:55PMunchWhat you're getting in is an array. This means that it will be a copy of the data in the array (or a pointer if Nim optimises it). When you use addr Nim complains because it can't really guarantee that you get the address you probably think you want and so tells you to use unsafeAddr to make sure that you know what you're doing.
07:07:47FromDiscord<Varriount> @PMunch it's because the array is a parameter. `addr` requires a var type
07:08:35FromDiscord<mattrb> I mean the address for the parameter is just somewhere on the stack, right?
07:08:39PMunchIf you change your code to take a "buffer: var FrameBuffer" argument then `addr` will work fine and it will point to the address of the buffer that was passed in. As it is now `buffer.unsafeAddr` can either point to the passed in buffer, or to a copy of it in your local scope, a bit depending on how Nim chooses to optimise.
07:08:51PMunchVarriount, yes that was I was trying to explain :P
07:09:17FromDiscord<Varriount> @mattrb It could also be in static (read-only) global memory.
07:10:22FromDiscord<mattrb> Ahh, gotcha I think. So the issue is just that it's not writable, and adding `var` in the parameter type would allow that to work if I wanted it to be writable. Since I don't want it to be writable and I know where I'm allocating the buffer, then `unsafeAddr` is probably just what I want
07:10:36PMunchAs it is now you could even pass it a "const" buffer which would create a copy, edit the data, and then promply delete it again :P
07:10:50FromDiscord<Varriount> @mattrb Yes.
07:10:50PMunchCorrect
07:10:53FromDiscord<mattrb> I normally use high level languages, and when I use c/asm I just completely abuse pointers until it works with no care to what I'm doing :p
07:10:56FromDiscord<mattrb> Thank you both ๐Ÿ™‚
07:11:36PMunchHaha, sounds familiar. Nim feels like a high level language, but when you get down into the nitty gritty things like this you realise that you're closer to C than you might think
07:12:37FromDiscord<Varriount> @mattrb If the C code you are calling tries to write to static memory (in the case of a constant) the program will crash.
07:13:06PMunchHowever Nim has a proper type system which can help you tell the difference between straight up abuse and clever tricks :)
07:13:06FromDiscord<mattrb> Good to know!
07:13:27FromDiscord<mattrb> Just case everything as a void , duh
07:13:43PMunchYeah.. That's not something you would do in native Nim code :P
07:14:11FromDiscord<Varriount> @mattrb If the C code tries to write to memory that a `let` variable has allocated, or a parameter, your program might crash, or unexpected behavior might occur
07:14:17FromDiscord<mattrb> I know x64 _pretty_ well, but have almost no knowledge of C. My C typically just reflects my x64 lmao
07:14:36FromDiscord<mattrb> @Varriount Also good to know! Thanks for the tips
07:15:26FromDiscord<Varriount> The "unexpected behavior" part is because the compiler makes certain assumptions about `let` variables.
07:16:40FromDiscord<Varriount> Normally it's able to ensure these assumptions are correct when compiling the program, but unsafeAddr is... unsafe
07:16:43PMunchI wrote some code for the Arduboy, a small Arduino powered GameBoy thingy. The C++ code it ran would load sprites into a void pointer and then draw things by passing a void pointer and dimensions. In my Nim wrapper I wrote a loading macro that on compile-time read the image files and encoded them as an array, giving them a generic type with height/width information. Now I could just call sprite.draw and it would already know the dimensions of the sprite
07:16:43PMunch(because the compiler remembered it) and it would ensure that e.g. a mask that had to be the same size would actually be the same size. This was all done without adding a single byte of runtime instructions as it was purely a type thing :)
07:17:53*opi joined #nim
07:18:19FromDiscord<mattrb> I've been working on this for awhile, but Crystal currently has _no_ reliable compilation with emscripten. I've been curious about Nim for awhile, and figured effectively rewriting this in Nim would allow me to learn a new language, as well as target a browser which would be nice ๐Ÿ™‚ https://github.com/mattrberry/CryBoy https://media.discordapp.net/attachments/371759389889003532/741193486052884560/unknown.png
07:18:40FromDiscord<mattrb> (edit) "I've been working on this for awhile, but Crystal currently has _no_ reliable compilation with emscripten. I've been curious about Nim for awhile, and figured effectively rewriting this in Nim would allow me to learn a new language, as well as target a browser which would be nice ๐Ÿ™‚ https://github.com/mattrberry/CryBoy ... https://media.discordapp.net/attachments/371759389889003532/741193486052884560/unknown.png" added "So fa
07:19:25FromDiscord<mattrb> That's funny that you mentioned Arduboy. I didn't see your message before I sent my own haha
07:23:58PMunchHaha, Nim is a good fit for this kind of stuff so I'm not surprised more people are trying it out for it :)
07:25:12FromDiscord<Ricky Spanish> been at nim for about 1 week now, loving that it more or less just takes what im used to in c/c++ and lets me re-do it in a simple safer way tbh, regret trying so many other things at the moment
07:27:26PMunchIt's great :) I came from a background with mostly C and Python with some sprinkling of other things like Java and Clojure. Nim lets me do all the stuff I could do in C, but with an elegance that beats anything else I've tried
07:28:29ZevvBut, did you do your CPS today?!
07:28:44Zevvbecause you know what they say: never skip CPS day!
07:29:48FromDiscord<mattrb> @PMunch Well I'm excited to try it out, and I'm sure I'll be back here to ask plenty more questions ๐Ÿ™‚
07:31:06PMunchZevv, haha :P I'm still using closure iterators for my coroutine needs :)
07:31:17Zevvyou are sooo lmae
07:32:03Zevvwe give you all the power in the world, we put a fision reactor in your basement, and here you are putting coal in your little stove
07:32:11Zevvduuude
07:32:44FromDiscord<Ricky Spanish> where is android support at? i seen hello world example but no activity generated example? is it do-able without java...or nimpossible at the moment? sorry had to say it
07:33:09Zevvwell, if you want to do UI's in Android, you need to be doing Java. If you want access to 95% of the API's in android, you need Java
07:33:36PMunchWell, the fision reactor you put in the basement is so complicated to use! I've been heating my house with my coal stove for weeks now not freezing to death while you're over there pouring over the manual to get your fision reactor started properly!
07:33:43Zevvso that makes it kind of hard for other ecosystems to jump in. It's possible to make basic apps using OpenGL for example, but you're pretty restricted
07:34:21ZevvPMunch: fine with me, we'll put up a considerate smile and wave through the back window when we come speeding by you in some time!
07:34:45Zevvjoking aside, it seems that things are slowly getting in a fairly usable state
07:35:26ZevvI can now built basic stuff like iterators, coroutines, exception handling, gotos and async
07:35:30Zevvwhich actually works
07:35:32FromDiscord<Yardanico> @Ricky Spanish it's possible but not easy
07:35:32PMunchCool, I'm really curious to see what comes of it! When I went on vacation you seemed to know where you where going with it, but struggled with some technical issues
07:35:51FromDiscord<Yardanico> See https://github.com/yglukhov/jnim
07:35:54PMunchOh wow, you've gotten quite far then :)
07:36:02FromDiscord<Ricky Spanish> maybe could wrap something like this? https://github.com/AshampooSystems/boden/
07:36:13Zevvyeah there's still some. Problem is that I kind of lost contact with the code when disruptek got going, and I can't make sense of it anymore. So now I'm basically just kicking him to do this and that and such. But that works out quite well :)
07:36:40PMunchHaha, yeah reading other peoples code is always a challenge!
07:36:58FromDiscord<Yardanico> And https://github.com/yglukhov/android
07:37:04Zevvwell, it is already quite complicated. I got stuk and tried a few more times but couldn't get there, while in the mean time disruptek _was_ able to
07:37:18Zevvso he's clearly smarter and more persistent then I am
07:37:26PMunchOooh, that boden thing actually looks really interesting @Ricky Spanish
07:37:32Zevvanwya, if you're interested: this is a total standalone example: https://github.com/disruptek/cps/blob/master/stash/echo_server_client.nim
07:37:59PMunchHe might've just gotten lucky ;)
07:38:04Zevvhas 3 parts: basic event queue implementation, then some socket glue to hide the POSIX stuff, and then the 'main' program which is a tcp echo server with 100 clients doing 20k echo/replies
07:38:08Zevvand a little timer
07:38:31ZevvThe interesting stuff starts at line 141, that is the "user part"
07:39:25FromDiscord<Varriount> @Ricky Spanish Try Nimterop
07:39:27Zevvand here is a little iterator implementation, the "user part" starts from line 37, above that is implementation of the iterator itself: https://github.com/disruptek/cps/blob/master/stash/iterator.nim
07:40:14FromDiscord<Ricky Spanish> @Varriount yeh will give it a test later today, the main issue might be the pre-requisites but i guess android devleopers are gonna expect some pre-reqs before being able to use it from nim
07:41:02FromDiscord<Varriount> @mattrb @creatable My first programming language was Python. I love it dearly, but was really glad when type annotations were introduced to the language.
07:41:41FromDiscord<Varriount> I find Nim to have a lot of the flexibility of Python (at least at compile time).
07:43:48Zevvand PMunch: you can have async I/O on your little arduinos
07:44:01PMunchThat would actually be really cool!
07:44:06Zevvhow cool is that right
07:46:23FromDiscord<mattrb> @Varriount `mypy --strict` or bust
07:48:53FromDiscord<Varriount> @mattrb I actually exchanged some messages with Jukka (the guy who started mypy) back when it was just starting out.
07:49:25FromDiscord<Varriount> Did you know the original intent for it was to be an optimizing compiler? Like Nuitka, Cython, etc.
07:50:51supakeenHaha, it's funny, I used to talk to the person who took that original intent and turned that into mypyc.
07:51:00supakeenWhich is exactly that :)
07:51:29FromDiscord<Varriount> supakeen: Hm, I thought that was still a prototype? Or maybe I'm thinking of something else.
07:51:46PMunchZevv, that is very cool
07:51:59FromDiscord<Varriount> So it went `compiler -> type checker -> compiler`
07:52:23FromDiscord<Varriount> Which I guess isn't all the unexpected, considering a compiler would have to do type checking anyway.
07:52:30supakeenVarriant: very much is, yes, I believe it supports a subset of Python for C compilation which is hinted by the types.
07:52:32supakeenYea.
07:52:59supakeenSeems like mypyc got merged into mypy: https://github.com/python/mypy/tree/master/mypyc
07:53:19FromDiscord<Varriount> supakeen: I tend to recommend Nuitka for "compiling" Python, as its worked well for me as a packaging tool.
07:53:56supakeenCurrently I mostly write C when I need to go fast (with CFFI) but I've been doing the Nimpy thing as well :)
07:54:08FromDiscord<Varriount> (although the compile time is quite terrible)
07:54:43FromDiscord<Varriount> supakeen: I don't need performance, so much as a decent way to distribute code onto systems.
07:54:57PMunch@Ricky Spanish, boden looks cool, but it still doesn't 100% solve your problem. If you want to use e.g. the locations API or other Android specific APIs then you are likely to have to write some Java glue code.
07:55:12supakeenVarriount: Ah, for that I have used pyinstaller in the past which worked well for my usecase.
07:55:45PMunchI just switched to Nim, much easier
07:56:00PMunchDistributing Python is such a pain in the ass..
07:56:05FromDiscord<Varriount> supakeen: Nuitka is good if you're working in a commercial environment.
07:56:45supakeenI will check it out.
07:56:59FromDiscord<Varriount> You get obfuscation for free, since it translates Python to the equivalent C code that uses the CPython extension API.
07:57:06supakeenPMunch: There's the rest of the team to deal with and the stability of software/libraries for now our rule is that we use Nim when we can rewrite it very quickly in another language.
07:57:25supakeenBut we do run quite a bit in production now :)
07:57:31FromDiscord<Varriount> supakeen: Other tools typically just embed the bytecode or source code within an executable
07:58:07FromDiscord<Ricky Spanish> @PMunch im more or less ok without many of the api's, i guess its really down to what things i cant do such as permissions etc since most apps will need storage and itnernet access, im gonna give it a try worst case its a waste of some time
07:58:24*oddp joined #nim
07:58:25supakeenSince I'm a reverse engineer half of the time I don't particularly care about the obfuscation factor an ELF binary supposedly provides.
07:59:15PMunchsupakeen, oh cool. I was lucky enough to be left to my own devices on the last project. So I just rewrote the entire thing in Nim, contributed a PR to the project we were integrating with to support loading dynamic libraries instead of just Python, and just told everyone that I had made the project much faster :P
07:59:17supakeenIn fact there's probably less people out there that know how to go from pyinstaller -> bytecode -> python than from ELF binary.
07:59:31FromDiscord<Varriount> supakeen: Heh. Well, it's another layer to put off curious eyes. Nuitka wouldn't stop a dedicated effort. But then again, what would?
07:59:53supakeenPMunch: We run a looot of VMs so it's neat whenever we can save the overhead of the Python vm for especially smaller services that run on them.
07:59:54FromDiscord<Ricky Spanish> python distribution was kinda ok until 2.7 and then came the big boy breaking changes, execute error 66 - print now uses curlys
07:59:57supakeenAnd Nim has been a *great* fit for that.
08:00:16FromDiscord<Varriount> supakeen: Could be worse, you could be dealing with the overhead of the JVM
08:00:18PMunch@Ricky Spanish, I think permissions are just requested through the manifest XML (at least it was last time I used Android..)
08:00:25supakeenHaha yes, Varriount.
08:00:34PMunchs/used Android/wrote Android apps
08:01:04FromDiscord<Ricky Spanish> @PMunch yeh but iv seen now in dart for example, and some java examples you can request the permissions in code too specific to the task not just before install....not sure if its a requirement or what but seen some samples
08:01:06FromDiscord<Varriount> supakeen: I wouldn't mind doing reverse engineering, though looking at assembly for prolonged periods does tend to make my eyes water.
08:01:50supakeenYea really it's not special, it's another job and probably even less creative than programming.
08:02:07supakeenIt's a lot of notetaking, mental map building, and experience.
08:02:20FromDiscord<Varriount> supakeen: For example, I once tried following how the C compiler ran a Nim closure. I had to give up on that one. It would probably be easier with the appropriate tools.
08:02:34FromDiscord<Varriount> compiled a Nim closure
08:02:39PMunch@Ricky Spanish, ah yes, you can request extra permissions after the app has been installed. I think that's only meant for someone enabling a feature after installing, e.g. Snapchat with their map feature will ask you to enable location permissions if you try to use it.
08:02:43supakeenHah, I haven't taken a look at Nim-stuff yet from that angle.
08:02:45supakeenI should.
08:04:04FromDiscord<Varriount> supakeen: The C code is fairly straightforward, but I think there's some interaction with the C compiler's optimizer that confuses things.
08:04:23FromDiscord<Varriount> (and complicates the emitted assembly)
08:05:23supakeenOh yea, there's plenty of weird stuff that optimizing compilers do like multiplication with constants to do certain things which looks *nothing* like what you'd expect until you realize 'oh so thats how it does modulus on arm'.
08:26:34FromDiscord<--HA--> is there an advantage in code size of the binary or for the compile time or anything if I do specific imports like `from os import joinPath` instead of just importing the whole module?
08:32:14FromDiscord<Yardanico> No
08:32:26FromDiscord<Yardanico> Nim always has dead code elimination enabled for all modules
08:32:37FromDiscord<Yardanico> Regardless if it's debug or release
08:34:32FromDiscord<--HA--> Awesome
08:36:13FromDiscord<Yardanico> about compile-time - I don't think it would change either
08:38:37FromDiscord<--HA--> This is probably a bit of a broad question with no one simple answer but I often wonder when it makes sense to assign something to a variable. If for example I use a result of a proc twice relativly close to each other. Will the compiler figure that out for me or should I assign the result to a variable so the work is not done twice?
08:39:09FromDiscord<Yardanico> compiler will probably not figure it out since that proc can have side effects and stuff
08:42:23*superbia1 is now known as superbia
08:43:15FromDiscord<--HA--> sent a code paste, see https://play.nim-lang.org/#ix=2tug
08:43:15superbiais nim code easier to decompile than let's say some code written in c/c++
08:43:25Yardanicono
08:43:40Yardanicoit's still fully native
08:43:48superbiaassuming you know, that it was a nim in the beginning
08:43:56Yardanicowell with refc there's RTTI
08:44:01Yardanicobut with arc/orc there's no RTTI
08:44:14Yardanicoonly some metadata for methods (when using with object inheritance)
08:44:21Yardanicobut you'll only get names of the objects this way, nothing more really
08:44:42YardanicoIt's probably not very hard to detect nim binaries specifically
08:44:46FromDiscord<Elegant Beef> for all intents and purposes it's C/C++ compiled
08:44:51superbiabut it would generate a cleaner decompiled source, right?
08:44:56Yardanicowhy?
08:45:13Yardanicoit's still compiled to a real binary
08:45:17Yardanicono VMs, no JITs, nothing
08:45:52superbiaso you never tried decompiling real binary into c?
08:45:56Yardanicoi tried
08:46:03Yardanicoand nim binary output isn't "cleaner"
08:46:15Yardanicoin fact it might be harder to understand than "idiomatic" C compiled to binary
08:46:26Yardaniconot sure why do you ask such questions if you have a lot of experience in reverse-engineering :)
08:46:30Yardanicowhy would a nim binary be easier to decompile
08:46:48Yardanicoif you compile in -d:danger there are no checks, no stacktraces, nothing
08:47:36Yardanicothere still will be exception messages, yes, but again - you won't figure out a lot with them
08:47:54superbiayou are right
08:50:53*waleee-cl joined #nim
08:51:25*Vladar quit (Remote host closed the connection)
08:52:09FromDiscord<--HA--> What is the recommended regex module to use? I saw re and nre. I want to do a simple replace of multiple spaces with only one. I dont specifically need regex if there is a better way. In ruby I would have done something like `"a b".gsub(/ +/, ' ')`
08:52:35Yardanicomystr.split().join(" ")
08:52:38Yardanicoimport strutilsd
08:52:40Yardanicostrutils*
08:52:55Yardanico!eval import strutils; echo "a b c d".split().join(" ")
08:52:57NimBota b c d
08:53:05Yardanicowait one sec
08:53:16*Romanson quit (Quit: Connection closed for inactivity)
08:53:38Yardanicoah well you can also use mapIt here
08:53:56Yardanico!eval import strutils, sequtils; echo "a b c d".split().mapIt(it.strip()).join(" ")
08:53:59NimBota b c d
08:54:03Yardanicolol
08:54:22Yardanicoweird
08:54:30Yardanicoohh I see
08:54:58schurigwhat exactly is a typedesc? E.g., when will proc `of`[T, S](x: typedesc[T]; y: typedesc[S]) called over proc `of`[T, S](x: T; y: S) ??
08:55:07Yardanico!eval import strutils, sequtils; echo "a b c d da s".split().filterIt(it != "").join(" ")
08:55:10NimBota b c d da s
08:55:31Yardanicoschurig: https://nim-lang.org/docs/manual.html#special-types-typedesc-t
08:56:09FromDiscord<--HA--> Thanks Yardanico
08:56:16Yardanicoschurig: in your case it's two different signatures
08:56:30Yardanicothe first one accepts "types" themselves, the second one accepts the values of the types
08:56:56Yardanicoin nim typedesc is a type to represent types at compile-time
08:57:50schurigah, thanks. I think I'll add a link from doc/html/system.html#typedesc to this, because the description in system.html of "Meta type to denote a type description" doesn't explain anything (to me)
08:58:12FromDiscord<Recruit_main707> @creatable they already helped you right?
08:58:21Yardanicoschurig: well I think that would be a bit of an overkill
08:58:32Yardanicobecause you could as well add other links to all of the system :P
08:58:35Yardanicobut that'd be too much
09:01:05*ee7[m] quit (Quit: Idle for 30+ days)
09:01:25FromDiscord<creatable> @Recruit_main707 yep! if I have any other issues I'll mention you though
09:05:58*synthmeat quit (Quit: WeeChat 2.9)
09:07:41*synthmeat joined #nim
09:22:08FromDiscord<Recruit_main707> Ok, if you are coming from python you might have some problems understanding pointers and references at first, but if you read the docs a bit you wont have any issue
09:33:49FromDiscord<--HA--> Turns out I need regex after all. What is the difference between `re` and `nre` modules?
09:34:01Yardanicocan you try https://github.com/nitely/nim-regex first?
09:34:06Yardanicoit's a pure-nim regex :)
09:34:14Yardanicoif you don't need the most performance it's the better choice
09:34:22Yardanicore and nre modules use PCRE
09:34:57FromDiscord<--HA--> I don't need special performance. I'll try it out
09:36:47FromGitter<jivank> Are there any task queues like python's huey for nim? https://huey.readthedocs.io/en/latest/
09:36:59FromGitter<jivank> I did find this: https://github.com/jackhftang/taskqueue.nim but its not clear if it runs in another thread
09:38:05alehander92ะดะฝะฝ
09:38:08alehander92ops, sorry
09:38:11Yardanicoalehander92: ะดะฝะฝ :P
09:38:14alehander92hahahaha
09:38:16Yardanicolyy
09:38:19alehander92i tried to write okk
09:38:26Yardanicooh you don't have a russian layout right
09:38:28alehander92but in our layout it is mapped to that
09:38:30alehander92oh no
09:38:50Yardanicoin russian layout ะด is under l, ะฝ is under y
09:38:53alehander92it's called ะ‘ะ”ะก it seems it was designed for our language to be more productive
09:39:00alehander92a lot of people use latin
09:39:03alehander92like phonetic*
09:39:19alehander92it's cyrillic but mapped e.g. ะณ g ะฟ p
09:39:24alehander92to similar sounds
09:41:30Yardanico4rak on a holiday - almost no activity in nim github :PP
09:43:51superbiai thought mr stale bot is pretty active
09:44:07Yardanicoyeah that person seems to be pretty active
09:44:10Yardanicolooking through old nim issues
09:50:04alehander92good thing we got pmunch back
09:54:02*apahl_ quit (Ping timeout: 244 seconds)
09:55:23*apahl joined #nim
09:56:52*moerm joined #nim
09:57:08moermHello everyone
09:58:37Zevvhello moerm
09:59:39FromDiscord<Yardanico> Hello IRC
10:01:12alehander92hello Yardanico
10:02:12alehander92ok, so moerm
10:06:23moermalehander92 Was that a hello or the entry to a question or remark?
10:07:00*azed joined #nim
10:13:19*Trustable joined #nim
10:13:26alehander92what do you think about `A@Kind` for variants
10:13:28alehander92type syntax
10:15:05alehander92basically flow typing for variant discriminators
10:15:09alehander92i planned onw riting a rfc
10:15:38alehander92but you are pretty into this kind of thing, so it would be cool to hear your feedback
10:16:01Zevvuuuuglyyyy
10:16:04alehander92(the point is to generalize the planned isNil checking mechanism for that`
10:16:18Zevvoh I was not asked, right? :)
10:16:19alehander92i mean the syntax doesn't matter to me it can be `A{kind}` i forgot
10:16:29alehander92there was a discussion whichi have to find
10:16:56alehander92but i have a rails interview soonish .. i have to read a bit about sql again
10:17:05alehander92i keep forgetting what exactly a join is man
10:17:44moermalehandler to be honest, a) I'm not a fan of new features but rather of getting rock solid what we have first
10:18:32moermb) my input means little, the person to ask is @Araq, and c) please ask more precisely
10:20:19moerm(my narrow small mind needs precise questions *g)
10:20:30FromDiscord<kodkuce> this http3, hmm does it separate GET,POST requests from socket ones so GET POST stay reliable ?
10:20:34Yardanicowell alehander92 had an RFC no?
10:21:10moermIf he provides a link to it I will look into it of course
10:21:53alehander92i don't have a rfc yet, i am a bit lazy
10:22:13alehander92ok, when i right it down i'll send it, to have an example
10:22:33Yardanicowell it's kinda hard to understand what you mean without context :)
10:22:39Yardanicoso yeah, with an RFC it'll bere better
10:23:02moermI'll also gladly tell you my view if the question is narrow enough and preferably verification/analysis related
10:23:16FromDiscord<Varriount> Alehander92: When thinking of JOINs, think of a Venn diagram
10:24:17FromDiscord<Varriount> Yardanico: If you know of any new or updated standard-library bugfix PRs, I'll be happy to review and/or merge them
10:24:30Yardaniconah don't worry :P
10:25:04FromDiscord<Varriount> Unfortunately 4raq is the only one that approves compiler PRs
10:25:23moerm"Unfortunately"??
10:25:36Yardanicomoerm: well he's on holiday rn :)
10:26:16alehander92yeah we could've added some {}
10:26:18alehander92until now man
10:26:20moermYardanico, So Nim can't change in its core for some weeks?
10:26:29Yardanicomoerm: it can, 4raq comes online sometimes :)
10:26:35moermTragedy!!!
10:26:47moermOK, so not really a tragedy ;)
10:26:51FromDiscord<Varriount> Just work on standard library improvements
10:27:12FromDiscord<Varriount> Goodness knows we need more of them
10:27:34FromDiscord<Varriount> Well, improvements in documentation, to be precise
10:27:59moerm... the classical problem ...
10:31:26alehander92yardanico thanks, the visual joins did help a lot
10:31:37Yardanico?
10:31:38alehander92now i need to read a bit on cool stuff db-s do
10:31:49alehander92oh sorry, thanks to Varriount *
10:32:14*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
10:32:52*pbb joined #nim
10:33:25moermDoes anyone know *where* Araq spends his holiday and when he'll be back?
10:33:40Yardanicohe's still online in IRC btw :)
10:33:51Yardanicoaround 2 weeks
10:35:08moermThanks (Oh, it's nothing particular just general interest)
10:36:27FromDiscord<Varriount> moerm: He's taking a vacation on Earth
10:42:02moermVarriount What a cunning guy to choose the one place where nobody expects him to be!
10:42:25alehander92:)
10:44:52*clyybber joined #nim
10:44:59Yardanicowow clyybber on irc
10:46:50clyybberdiscod forced update forced me
10:47:07Yardanicowelcome to boomers' zone
10:47:19clyybbermoerm: I guess somewhere in germany, because of corona
10:47:25clyybberYardanico: lol
10:48:21moermclyybber, Thank you, but it was just general interest. I hope he can relax and have some fun (other than Nim)
10:48:59*clyybber quit (Client Quit)
10:49:15*clyybber joined #nim
10:53:53*clyybber quit (Client Quit)
10:54:26moermThat poor guy (clyybber) seems to have connectivity problems
10:54:34Yardanicohehe
10:54:47FromDiscord<Recruit_main707> Should have stayed in discord :p
10:54:48superbia(Client Quit) != connectivity problem
10:54:53Yardanico@Recruit no
10:54:56Yardanicodiscord is pretty bad
10:55:00superbiadiscord is shit
10:55:03Yardanicoimagine no color support
10:55:16FromDiscord<Recruit_main707> (Images)
10:55:21Yardanicoabsolute ,08blasphemy
10:55:31Yardanicothere are IRC clients with image previews and other stuff
10:55:37Yardanicoit doesn't have to be server-side
10:55:56FromDiscord<Recruit_main707> Tbh if the new ts client has images, im all in for it
10:56:12YardanicoMumble exists for voice chat
10:56:20FromDiscord<Recruit_main707> But discord currently rules the monopoly
10:56:42Yardanicobecause GaMeRs !1111
10:56:44moermClueless me simply took the first simple client ('hexchat') and it seems to work fine
10:57:36moerm(I'm wondering a bit though why "we" chose discord ...)
10:59:37Yardanico"we" didn't
10:59:40Yardanicoit's just getting popularized
10:59:44Yardanicoand people use it out of convenience
10:59:52YardanicoI created the nim discord server in 2017 but I didn't use it
11:00:01Yardanicoand really not a lot of people used it until ~2019
11:00:10moermHmmm
11:00:31moermI don't care much anyway, as long as the thing works
11:00:35Yardanicohttps://forum.nim-lang.org/t/3272
11:00:49*maier quit (Ping timeout: 264 seconds)
11:00:55Yardanicomy old account
11:01:00Yardanico(you can't change nickname on nimforum)
11:01:38FromDiscord<lqdev> 404 not found
11:01:43Yardanico?
11:01:51FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/741249740347408435/unknown.png
11:01:56moermYardanico, So you called yourself 'Tiberium' back then? I'm a C&C fan too, one of the *very few* games I play at all
11:02:11Yardanicomoerm: yes, my old nickname(s) were Tiberium/Tiberiumk
11:02:16YardanicoI've used them in quite a lot of places
11:02:57YardanicoI had to create a new reddit accouint as well :)
11:04:07moermI am 'moerm' * spilling the beans
11:04:17FromDiscord<kodkuce> @treeform would it be bad to just use |Sec-WebSocket-Protocol| for my auth header, example for protocol i can put [ default, myauthheader ] and then just hack you ws.nim to just alwies return protocol 0 , cuz from what i see RFC6455 i just need to return 1 of protocols, so i allwies return just protocolo[0] in my case default
11:05:17moerm(desaster in creation ...)
11:07:32FromDiscord<kodkuce> that reply to me ?
11:07:49*maier joined #nim
11:07:52FromDiscord<kodkuce> (edit) @treeform would it be bad to just use |Sec-WebSocket-Protocol| for my auth header, example for protocol i can put [ default, myauthheader ] and then just hack you ws.nim to just alwies return protocol[0] , cuz from what i see RFC6455 i just need to return 1 of protocols, so i allwies return just protocolo[0] in my case default
11:08:20FromDiscord<kodkuce> i gona try
11:08:26moermkodkuce Yes, it is
11:08:46moermBut more a remark than a reply
11:09:20FromDiscord<kodkuce> why you think that will now work or be not secure?
11:10:22*oriba joined #nim
11:10:44moermOh, it might somehow work, at least in one well defined context. As for the "why": Lots of experience
11:11:55FromDiscord<kodkuce> i am just missusing a header field for my doings cuz i am not allowed to send custom headers
11:12:15*maier quit (Read error: Connection reset by peer)
11:12:50*maier joined #nim
11:12:53moermDo as every you feel like. My remark was just that, a remark
11:17:43*maier_ joined #nim
11:17:47*Guest53507 quit (Ping timeout: 240 seconds)
11:18:00FromDiscord<kodkuce> i will, i just tough you have some magic insight of how i am shooting myself in foot ๐Ÿ™‚
11:18:02*maier quit (Ping timeout: 265 seconds)
11:23:21*opi quit (Ping timeout: 265 seconds)
11:26:11moerm'_This section is non-normative._' sounds like really good stuff ...
11:31:59PMunchmoerm, I'm also using HexChat, it's a pretty good one
11:32:18PMunchCertainly some features I'd like to see, but all in all it's pretty good
11:34:15moermPMunch I don't know much about chat clients. Hexchat allows me to talk to you and that's all I need and expect.
11:34:29moerm(I'm chatting almost only here)
11:34:58*arecacea1 quit (Remote host closed the connection)
11:35:44PMunchThat's what I like about IRC, just join the correct channel and start typing
11:35:47PMunchNo frills
11:36:42moermYep. There's already more than enough fat bloated shi^H^H^H software out there ...
11:36:47PMunchAnd since you can choose your own client you can get one that doesn't have tons of whitespace and massive font size
11:37:25*arecacea1 joined #nim
11:37:25PMunchLike right now I can see messages as far back as 12:17 in this channel
11:39:33moermYes, having a little history is nice
11:50:14moermHave a nice day everyone
11:50:29*moerm quit (Quit: Leaving)
11:59:46*opi joined #nim
12:02:11FromDiscord<Recruit_main707> thx, u too
12:04:44FromDiscord<Recruit_main707> You know what would be cool? Having a c2nim website to create the wrappers online
12:04:55Yardanicowhy?
12:05:04Yardanicoyou still need a computer
12:05:07Yardanicowith an IDE
12:05:10Yardanicofor manual changes and stuff
12:05:47FromDiscord<Recruit_main707> Depends on the size of what you want to wrap/transpile
12:05:56Yardanicostill don't see a purpose in it :)
12:06:01FromDiscord<Recruit_main707> I woulsnt use it for large projects obv
12:06:01*supakeen quit (Quit: WeeChat 2.8)
12:06:42*supakeen joined #nim
12:07:01FromDiscord<Recruit_main707> If you want to do it for a small function or just a few, it would be easier to do it in a web than on your pc directly
12:07:18FromDiscord<Recruit_main707> (imo)
12:07:26Yardanicowhy?
12:07:33Yardanicoyou can install c2nim via nimble
12:07:44Yardanicoi really don't understand the convenience in this case
12:07:49Yardanicoyou'll still need to copy it in your project
12:07:53Yardanicoso you'll use an editor
12:08:13FromDiscord<Recruit_main707> To simplify things a bit
12:08:24Yardanicookay, but I don't get it at all :)
12:08:36YardanicoI don't see a simplification where you will have to use a whole browser to do such simple thin gs
12:10:04*dulsi_ joined #nim
12:10:12FromDiscord<lqdev> objectively, typing a command into a terminal is much quicker than having to open a website, select a file, and then download a file to the correct location.
12:11:48*oriba left #nim ("https://quassel-irc.org - Chat comfortably. Anywhere.")
12:12:25*dulsi quit (Ping timeout: 240 seconds)
12:14:57Zevvssst don't tell that stuff to others. That's the only reason I still can stay ahead of the new kids these days.
12:19:14FromDiscord<lqdev> meanwhile your terminal can't display ๐ŸŽต because you're staying "ahead" with an ASCII-only font :)
12:19:42FromDiscord<lqdev> Yardanico please tell me your bridge supports emojis
12:19:46Yardanicoehm
12:19:49Yardanicowhy would it not
12:19:54YardanicoI don't handle UTF-8 in any specific way
12:20:04Yardanicoit just works
12:20:08FromDiscord<lqdev> idk, discord uses special syntax for that
12:20:15Yardanicono
12:20:17Yardanicoonly for discord emotes
12:20:25Yardanicoand for that I convert the ID to textual representation
12:20:29YardanicoI can't do any better
12:20:32FromDiscord<lqdev> but maybe they turn that into unicode client-side or server-side
12:20:34FromDiscord<lqdev> ok
12:20:37FromDiscord<lqdev> good
12:20:49FromDiscord<lqdev> i can annoy zevv with squares
12:20:52Yardanico๐Ÿ‘‘
12:20:59FromDiscord<lqdev> ๐Ÿ‘Œ
12:21:03Yardanico๐Ÿ‘Œ
12:21:09Yardanico๐Ÿ†—
12:21:53FromDiscord<lqdev> ๐Ÿ‡ฟ ๐Ÿ‡ด ๐Ÿ‡ด ๐Ÿ‡ฒ ๐Ÿ‡ช ๐Ÿ‡ท
12:22:11FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/741269957165187243/unknown.png
12:22:16Yardanicobut it depends on the font of course
12:22:26FromDiscord<lqdev> no dude don't show him
12:22:45FromDiscord<kodkuce> sent a code paste, see https://play.nim-lang.org/#ix=2tuX
12:23:47FromDiscord<kodkuce> req.headers["sec-websocket-protocol",1] meybe will try that now
12:24:31FromDiscord<kodkuce> yep that works
12:25:01FromDiscord<kodkuce> tough i was expecting req.headers["sec-websocket-protocol"] to give me a seq of all values
12:25:33*dulsi_ is now known as dulsi
12:29:45dulsiAnyone play with windows cross compiling and using wine? I built smalltrek using it but it can't load SDL2.dll even if it is in the same directory.
12:30:07Yardanicochecked that the architecture matches?
12:30:14Yardanicoboth the dll and .exe should be of same architecture
12:30:24Yardanicoalso there might be more dependencies than just SDL2.dll
12:31:03Yardanicotry to compile to x64
12:31:07Yardanicoand unzip all from https://www.libsdl.org/release/SDL2-2.0.12-win32-x64.zip
12:31:48*rockcavera joined #nim
12:32:06opiI once cross-compiled SDL for Windows and ran it with wine, worked for me, I know it isn't helpful, but I don't even reacall what I was playing with
12:32:10dulsiArgh. You are probably right. It is the wrong architecture.
12:32:15Yardanicoopi: you don't need to cross-compile :)
12:32:18Yardanicothey provide binaries
12:32:28opiYardanico: I mean Nim binary
12:32:37opiI grabbed the DLLs from them ;)
12:32:42opiand put them in .
12:32:44Yardanicowell your message was a bit misleading :P
12:32:49Yardanico"cross-compiled SDL"
12:33:08opiSDL using program โ€” what I intended to say :P
12:33:21opiit's 32ยฐC, I'm a bit groggy
12:35:33*Trustable quit (Remote host closed the connection)
12:38:26dulsiWorks fine after I grabbed the dlls for the right architecture. Thanks.
12:42:37FromDiscord<kodkuce> hmm wtf am i getting error mistmatch when proces accepts that argument
12:43:20FromDiscord<kodkuce> oh i think i know
12:43:59FromDiscord<kodkuce> or not i tough it was not exported but it is
12:50:15FromDiscord<XxDiCaprioxX> How do I get mouse input?
12:50:37Yardanicouse OS-specific APIs :)
12:50:55Zevvuse OS-specific APIs :(
12:50:57FromDiscord<XxDiCaprioxX> How do I do this? Is there something to import?
12:50:59FromDiscord<kodkuce> am i retarded or what? https://pastebin.com/PN6J721B
12:51:09ZevvXxDiCaprioxX: what platform are you targeting?
12:51:16Yardanico@kodkuce the error is clear
12:51:18FromDiscord<XxDiCaprioxX> Windows
12:51:29Yardanicoyou can either call newWebSocket with 1 argument being Request
12:51:33ZevvDo you have soemthing that opens a window yet?
12:51:40Yardanicoor with TWO arguments one of them being the url, and the other being the protocol
12:51:44Yardanicoand they're strings
12:51:50FromDiscord<XxDiCaprioxX> No but do I need it?
12:51:57FromDiscord<XxDiCaprioxX> Like I know I will need a window
12:52:10Zevvwell, I guess you want to know the mouse cursor location in your window
12:52:21FromDiscord<XxDiCaprioxX> Yes
12:52:42FromDiscord<XxDiCaprioxX> Okay but the only important question is: can you give me a name?
12:52:46Zevvok, so that's where you start. You need a way to open a window with some kind of API, and these API's typicaly support the iput handling
12:52:52ZevvI'd pick SDL
12:52:57Zevvbut depends on what you want to do i your window
12:52:59FromDiscord<XxDiCaprioxX> Okay, thank you
12:53:08Zevvyou want to do native windows stuff, low level bitmap graphics, opengl. It all depends
12:53:14FromDiscord<XxDiCaprioxX> A game only using mouse input?
12:53:16FromDiscord<kodkuce> @Yardanico hmm proc newWebSocket(req: Request, protocol: string = ""): Future[WebSocket] {.async.} = isent first arg req and seocnd string?
12:53:16Zevvit's not in any way a "Nim thing"
12:53:29ZevvXxDiCaprioxX: sure, but I guess you also want to draw things?
12:53:35Yardanico@kodkuce where did you see that?
12:53:37FromDiscord<XxDiCaprioxX> Yes
12:53:49FromDiscord<XxDiCaprioxX> I need a window but like is SDL suitable?
12:53:49Zevvso, how will you be drawing that? framebuffers, openGL?
12:53:53Yardanico@kodkuce I don't see such an overload here https://i.imgur.com/hxCiJ3i.png
12:53:54FromDiscord<kodkuce> https://github.com/treeform/ws/blob/master/src/ws.nim#L85
12:54:08Yardanicoare you sure you're using the correct version of ws?
12:54:09Yardanicowhich has that?
12:54:10FromDiscord<XxDiCaprioxX> Framebuffers
12:54:20ZevvSDL is all about that: it provides you the window, the input handling for mouse and keyboard, and primitives for drawing bitmap stuff, or creating an EGL context for you to do OpenGL in
12:54:22Yardanicothat proc was changed 19 days ago
12:54:27Yardanicoit doesn't have a release yet properly
12:54:29Yardanicoprobably*&
12:54:36Yardanicoyes it doesn't
12:54:43Yardanicoso you have to install the head
12:54:47Yardanicohttps://github.com/treeform/ws/commit/d0b31d13bf32f75b7e0964ad0d4e93b2736dcf26
12:54:49FromDiscord<XxDiCaprioxX> Okay, that is it, I'll learn all the neccessary stuff by myself. Thank you
12:54:54ZevvSDL is the way to go. then. and if you take care not to do any windows-specific things your code is likeley to be portable to MacOs and Linux as well
12:55:07FromDiscord<XxDiCaprioxX> Nice
12:55:16opiyeah, SDL is pretty good commong ground if you want bitmaps and windows
12:55:18FromDiscord<kodkuce> treeforms/ws
12:55:27Yardanicoyes
12:55:32Yardanicoyou need latest version (last commit from github)
12:56:32FromDiscord<kodkuce> ok
12:56:41FromDiscord<kodkuce> sorry i missed you post up
12:57:22*apahl quit (Ping timeout: 244 seconds)
12:58:38*apahl joined #nim
13:00:13FromDiscord<kodkuce> how to install head, i try using github link with last commit but did not work, only other way i know is to copy paste in same dir xD
13:01:38opikodkuce @#branch in nimble
13:01:57opiah, you mean stright from Git
13:02:01opisorry
13:02:18Yardanico@kodkuce do as opi told you
13:02:29FromDiscord<kodkuce> ty
13:02:36FromDiscord<XxDiCaprioxX> Well looks like I have to bother y'all again
13:02:42opiYardanico: it works the same for Git URI? Nice. Never had to grab something like that
13:02:52Yardanicoopi: he uses a nimble package
13:02:56FromDiscord<XxDiCaprioxX> When installing mingw to which path do i have to add it? to the top or bottom one?
13:03:08opiah
13:03:24opidamn, I should go sit in a chair, I'm clearly confused today
13:04:13FromDiscord<kodkuce> opi solution wokred i did nimble install ws@#head
13:06:23*clyybber joined #nim
13:07:08*clyybber quit (Client Quit)
13:07:18*clyybber joined #nim
13:12:01schurigsomeone forgot to update the channel topic, latest version is 1.2.6, not 1.2.0
13:12:10Yardanicoit's updated very rarely :P
13:16:40FromDiscord<XxDiCaprioxX> How do I render an image using sdl2?
13:18:24*audiofile joined #nim
13:19:01Yardanicodo you want to make a game?
13:20:26clyybberlol @ the 65535 issue
13:20:38YardanicoXD
13:20:39clyybber"issue"
13:20:54FromDiscord<XxDiCaprioxX> yes I do
13:21:26YardanicoI would suggest using https://github.com/Vladar4/sdl2_nim as a (a bit more nimatic) sdl2 wrapper
13:21:34Yardanicothere's also https://github.com/Vladar4/nimgame2 https://github.com/ftsf/nico
13:22:27FromDiscord<XxDiCaprioxX> Thank you for the links, but for the beginning I don't want to use engines
13:22:35Yardanicosdl2_nim is not an engine
13:22:47Yardanicohttps://github.com/Vladar4/sdl2_nim/blob/master/examples/ex201_textures.nim
13:22:59audiofilesdl2 is kinda cool
13:23:15FromDiscord<XxDiCaprioxX> I know, I was referring to nimgame2 and nico
13:23:33Zevvclyybber
13:23:37clyybberZevv
13:23:39YardanicoZevv
13:23:40Zevvoi!
13:23:42clyybberYardanico:
13:23:43clyybberoi!
13:23:46ZevvDid you have any hunch about https://github.com/nim-lang/Nim/issues/15118 yet?
13:23:47Yardanicoclyybber
13:23:47Yardanicooi!
13:23:48disbotโžฅ Cgen error: genSym fails to make unique identifier for ref object types ; snippet at 12https://play.nim-lang.org/#ix=2sHS
13:23:57FromDiscord<XxDiCaprioxX> I already have the other Nim wrapper but I'll go for this one if it is better?
13:24:09FromDiscord<XxDiCaprioxX> But how do I install iz
13:24:09YardanicoIt seems to have a better Nim interface than one in nim-lang, yes
13:24:32clyybberZevv: I think that gensym in vm is wrong
13:24:32FromDiscord<exelotl> nico is also not much of an engine - it doesn't give you scenes, entities, physics etc. Just a nice API for retro graphics, input and sound
13:24:47clyybberZevv: But thats not the only issue I think
13:24:52FromDiscord<XxDiCaprioxX> But for the beginner stuff I won't need it either way xD
13:25:04clyybberZevv: gensym generates unique symbols but somehow they get mixed up later
13:25:07Yardanico@XxDiCaprioxX nimble install sdl2nim
13:25:15FromDiscord<XxDiCaprioxX> is that all i have to do?
13:25:17FromDiscord<XxDiCaprioxX> nice
13:25:19FromDiscord<XxDiCaprioxX> thank you
13:25:23clyybberZevv: Although gensym could generate "more unique" ones, that don't exercise the underlying bug
13:25:25Yardanicowell, and then read sdl2_nim docs
13:25:32Zevvclyybber: ok, right. I wondered if this was something I could find myself, but I'm not at all acquainted with that part of the compiler
13:25:40clyybberZevv: I think you can
13:25:45Yardanicoit might conflict with normal sdl2
13:25:45FromDiscord<XxDiCaprioxX> okay, so basically just how you install other stuff like nico
13:25:54clyybberZevv: The gensym part is opcGenSym
13:25:58FromDiscord<XxDiCaprioxX> oh okay
13:26:01ZevvI can always just push a half baked PR and let the PR discussion solve it for me, that usually works
13:26:02FromDiscord<XxDiCaprioxX> I'll have to look
13:26:03clyybberThe other part; I have no idea :D
13:26:04FromDiscord<exelotl> sdl2_nim is way better than the other sdl2 wrapper, because its well documented and follows the C API closely
13:26:07Yardanicoyeah
13:26:12clyybberZevv: Yeah haha
13:26:16Zevvok, thanks!
13:26:37*azed quit (Quit: WeeChat 2.9)
13:26:58PMunchHmm: https://community.arduboy.com/t/game-jam-5-pretty-simple/9067
13:27:02FromDiscord<XxDiCaprioxX> Package 'sdl2_nim' has an incorrect structure. It should contain a single directory hierarchy for source files, named 'sdl2_nim', but file 'atomics.nim' is in a directory named 'sdl2\private' instead. This will be an error in the future.
13:27:09Yardanicodon't worry
13:27:13Yardanicoquite a lot of packages have that warning
13:27:18FromDiscord<XxDiCaprioxX> ok
13:27:35FromDiscord<XxDiCaprioxX> now I just need the dependencies and I'm good to go?
13:27:49Yardanicowell, if you're on linux, chances are - SDL2 is already installed
13:28:46FromDiscord<XxDiCaprioxX> Nevermind I already have sdl2 because I intalled the other wrapper too lol
13:31:16clyybbertype A = proc() {.nimcall.}
13:31:18clyybbervar b = "hey"
13:31:20clyybbervar a: A = proc() =
13:31:23clyybber echo "hey"
13:31:24clyybber echo b
13:31:33PMunchclyybber...
13:31:35clyybberThis shouldn't really compile, should it
13:31:41clyybberPMunch: Hey, it was only 5 lines :p
13:31:52Yardanicob is a global
13:31:54PMunchThat's 4 lines too many..
13:32:05Yardanicoclyybber: but b is a global
13:32:07clyybberYardanico: damnit, yeah
13:32:09Yardanicoso it doesn't have t obe a closure
13:32:31Yardanicoobe
13:32:32FromDiscord<Recruit_main707> have t obe xD
13:35:58FromDiscord<XxDiCaprioxX> So, now that I have the wrapper, how do I create the Window?
13:36:15Yardanicocheck the examples? :)
13:36:26Yardanicohttps://github.com/Vladar4/sdl2_nim/blob/master/examples/ex101_init.nim
13:36:29Yardanicoall in https://github.com/Vladar4/sdl2_nim/tree/master/examples
13:36:36FromDiscord<XxDiCaprioxX> okay thanks
13:41:03FromDiscord<XxDiCaprioxX> Do I just compile and run?
13:41:27Yardanicowell, you can dance if you want
13:42:03FromDiscord<XxDiCaprioxX> great idea
13:42:50FromDiscord<XxDiCaprioxX> I mean because with Nico I had to do some specific command instead of F6 in VS Code
13:42:54FromDiscord<XxDiCaprioxX> That's why I asked
13:43:10Yardanicoyou could do F6 with nico too, you just had to do some simple changes in the cfg
13:43:15Yardanicoyou can run it with F6, yes
13:47:38clyybberis trialism here?
13:47:46YardanicoI don't think so
13:47:53Yardanicoit was their first issue in nim repo
13:48:27clyybberyeah, seems fishy
13:48:32clyybberalso kinda toxic
13:49:11Yardanicooh I think they did open some nim issues
13:49:16Yardanicobut then deleted (?) the account
13:49:18Yardanicoe.g. see
13:49:19Yardanicohttps://github.com/nim-lang/nimble/issues/651
13:49:21disbotโžฅ getProxy() doesn't handle proxies properly ; snippet at 12https://play.nim-lang.org/#ix=2tvb
13:49:25Yardanicoand see how 4raq replied https://github.com/nim-lang/nimble/issues/651#issuecomment-491232594
13:49:26disbotโžฅ getProxy() doesn't handle proxies properly ; snippet at 12https://play.nim-lang.org/#ix=2tvb
13:49:45Yardanicobut idk if it's feasible to really change the max line count
13:49:56Yardanicois it a performance/memory impact?
13:50:07YardanicoI guess it's 2 more bytes for each TLineInfo
13:50:53Oddmonger??! var truc:seq[string]=@[โ€ฆ] # undeclared identifier '=@'
13:51:11Yardanicouse proper spacing :)
13:51:43Oddmongernot the first time i have space problem (is Nim an extension of my flat ?)
13:52:34Oddmongeris it a problem like ">>" (shift) vs "> >" (template) in C ?
13:53:56Oddmongerin other words , does ยซ =@ ยป introduces ambiguity ?
13:53:57Zevvdisruptek: where is your mangling branch
13:54:14clyybberhttps://github.com/disruptek/Nim/tree/mangling
13:54:42Zevvthanks
13:55:30*waleee-cl quit (Quit: Connection closed for inactivity)
13:55:52PMunchOddmonger, https://nim-lang.org/docs/manual.html#lexical-analysis-operators
13:56:14PMunchYour problem is that =@ is a legal operator, and [] is read on its own
13:56:39PMunchSo it's parsed as [string] =@ [...] and not [string] = @[...]
13:56:49Oddmongerahhh
13:56:51Yardanicoexactly
13:57:01Oddmonger=@ an operator, didn't know
13:57:07Oddmongerso there's ambiguitรฉ
13:57:37Oddmongerambiguity
13:57:40PMunchWell any combination of the characters listed in the link I sent is valid as an operator name
13:57:49Yardanicothere's no ambiguity :)
13:57:53PMunchMais oui, c'est ambiguitรฉ
13:57:59narimiranhardcore F1 fans know: "you always-a have to leave-a the space-a!"
13:58:03Yardanicoyes
13:58:05PMunchWell ambiguous to a reader
13:58:12YardanicoI don't like it when I see nim code with weird spacing
13:58:30Yardanicoproc hello ( name : string ) : string
13:58:49PMunchproc hello ( name:string ) :string
14:02:15clyybberwhat makes most sense to you guys conceptually; having {.nimcall.} force the calling convention ccNimCall and no explicit be ccImplicit
14:02:31clyybberOr to have a symflag that says: calling convention was explicitly provided
14:05:06Oddmongerwhat does =@ do ? didn't find in the link above
14:05:12Yardaniconothing
14:05:14Yardanicobut you can define it
14:05:26Yardanicofrom that link you can define operator with any combination of characters
14:05:31Yardanicoand =@ is a valid combination for a custom operator
14:05:32*tane joined #nim
14:05:35Zevvpff I give up already. Too hot for compiler debugging
14:05:51Oddmongerah i see
14:06:46*PMunch quit (Quit: Leaving)
14:07:17schurigis there a way to hide the "CC: stdlib_io.nim" messages of the compiler?
14:07:22Yardanicoyes
14:07:35clyybberhint:Processing:off I think
14:07:41Yardanico--hint[CC]:off
14:07:44Yardanicoclyybber: that's the dots
14:07:44clyybberah, right
14:07:46Yardanicofor the nim modules
14:08:02narimiranor just `--hint:off` to hide everything ;)
14:08:16Yardanicothen -w:off --hints:off --verbosity:0
14:08:19schurigthanks
14:08:21Yardanicoto make that stupid compiler be silent /s
14:09:06schurigas I don't yet know if/which hint can be helpful, I turn them off selectively, currently Link, Exec, CC, Success, Processing and Conf
14:09:39schurig*SuccessX
14:10:21Yardanico"pico-optimization" :(
14:10:29Yardanicothat's why we can't have nice things and people make electron apps
14:19:25FromDiscord<Ricky Spanish> how can i test if a nimterop library actually runs? i get ``` Nothing to build. Did you specify a module to build using the `bin` key in your .nimble file?``` when the nimble file is quite basic since the example of nimterop was more .nim file heavy
14:19:36Yardanicowdym "actually runs"?
14:20:14FromDiscord<Ricky Spanish> i mean actually downloads the dependencies listed inside the getheader i guess
14:20:15Yardanicotry to use some procedures the thing you're wrapping
14:23:24shashlick@Ricky Spanish you need to tell nimterop what to do - see the -d:xxx flags
14:23:48FromDiscord<Ricky Spanish> ah ok thanks for the tip @shashlick
14:24:42shashlickWhat are you wrapping
14:25:46*audiofile quit (Quit: Default Quit Message)
14:27:07FromDiscord<Ricky Spanish> i have a dll that just adds 2 numbers from c, im including the header from c and trying to find a way to download the dll. but iv not even made it that far yet im just trying the demo
14:27:20FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2tvg
14:27:25FromDiscord<Ricky Spanish> but it fails at the getheader
14:27:40FromDiscord<Ricky Spanish> No build files found in \nimcache\nimterop\wrap
14:27:51*clyybber quit (Quit: WeeChat 2.9)
14:28:11FromDiscord<Ricky Spanish> id expect it to fail for the obvious urls and things, but its looking for a build file
14:34:01FromDiscord<Zachary Carter> https://github.com/nim-lang/Nim/blob/devel/lib/std/monotimes.nim#L50 looks wrong to me according to https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time
14:34:56Yardanicochange it? :P
14:35:18FromDiscord<Zachary Carter> I will - I just hope it doesn't break a lot
14:35:56shashlick@Ricky Spanish - what's your command line
14:36:07FromDiscord<Zachary Carter> how can I run tests locally Yardanico?
14:36:19FromDiscord<Zachary Carter> to ensure that the change doesn't break stuff
14:36:27Yardanicojust run the module itself lol
14:36:37Yardanicoit seems to have "some" tests in the module itself
14:36:38FromDiscord<Zachary Carter> okay
14:37:08FromDiscord<Ricky Spanish> for ```nimble build -d:danger``` i get ``` Nothing to build. Did you specify a module to build using the `bin` key in your .nimble file?``` when i nim c the wrapper i get the no build file found
14:37:19Yardanicowell, you need a .nimble file then
14:37:22Yardanicowith your main entry point
14:37:26Yardanicowhich imports the nimterop definition
14:37:26Yardanicoetc
14:37:54shashlickfor starters, try nim c -d:headerGit -r file.nim
14:38:07shashlickthat tells nimterop to go down the git path
14:39:21FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2tvl
14:40:20shashlickyou need `bin =` in your nimble file
14:40:22shashlickfor build
14:42:23*noonien quit (Quit: Connection closed for inactivity)
14:42:25FromDiscord<Ricky Spanish> ah ok, so if i dont do it then it will basically only build once included by another nim project?
14:42:41shashlicknimble won't know what to build
14:42:47disruptekZevv: that didn't take long.
14:43:04FromDiscord<Ricky Spanish> oh so i always need the bin path?
14:43:29FromDiscord<treeform> @kodkuce an you open an issue on github with your paste?
14:43:43shashlickhttps://github.com/nim-lang/nimble/#binary-packages
14:44:00FromDiscord<Ricky Spanish> thanks @shashlick
14:54:46*abm joined #nim
14:57:32FromDiscord<kodkuce> @treeform nah, do i have to ๐Ÿ™‚ , i duno if that is an issue even tough i think it is
14:57:55FromDiscord<kodkuce> https://pastebin.com/hmN04x2R
14:58:23FromDiscord<kodkuce> my simple question was if i return befor even establish ws connection shoudent client error out
15:01:19Zevvdisruptek: what did
15:01:30Zevvor, what didn't
15:01:52*apahl quit (Ping timeout: 260 seconds)
15:02:24*natrys joined #nim
15:02:37FromDiscord<treeform> it should
15:02:55*apahl joined #nim
15:05:54disruptekwell, damnit, it did not.
15:05:57FromDiscord<Technisha (LGBTQIAP+)> Is `return false if user.id not in allowedIDs else return true` valid Nim code?
15:06:07Yardanicono
15:06:18FromDiscord<Technisha (LGBTQIAP+)> Oh okay
15:06:21Yardanicoalso you can simplify it greatly
15:06:23FromDiscord<treeform> @kodkuce "Currently only the synchronous functions support a timeout. " from https://nim-lang.org/docs/httpclient.html#newAsyncHttpClient%2Cint%2CProxy
15:06:33FromDiscord<Technisha (LGBTQIAP+)> Oh?
15:06:36FromDiscord<treeform> I guess I can try making my own timeout based on timers?
15:06:48Yardanicoreturn user.id in allowedIDs
15:06:51Yardanicothat'll do the same logically
15:07:05Yardaniconot sure why do you have to make it in such a complex way
15:07:17FromDiscord<Technisha (LGBTQIAP+)> Oh
15:07:21FromDiscord<Technisha (LGBTQIAP+)> Thanks :P
15:07:31disruptektreeform: you could use cps.
15:08:28disruptekgetting cps into ws would be huge.
15:08:46disruptekwe'd get a lot more feedback. really big.
15:08:51disruptekbigly, i mean.
15:08:54disruptektremendous.
15:08:57Yardanicodisruptek: no
15:08:59Yardanicobigly it is
15:09:08Yardanicobiggy
15:09:10Yardanicocpssy
15:09:14Oddmongerbugly
15:09:15Yardanicoflatty
15:09:16Yardanicobinny
15:09:20disruptekbuggly
15:09:29Oddmongertoo slow disruptek
15:09:39disrupteki'm riffing on you, chucklehead.
15:09:50FromDiscord<treeform> slappyโ†ตflippyโ†ตproffy
15:09:59disrupteki know, i think you have an illness.
15:10:03YardanicoLOL
15:10:07disrupteki've been meaning to speak to you about that.
15:10:21FromDiscord<kodkuce> what
15:10:22disruptekit's like you've got your own little colored ecosystem.
15:10:25FromDiscord<treeform> ~ branding ~
15:10:26disbotno footnotes for ``. ๐Ÿ™
15:10:30disrupteki should have thought of that for my ecosystem.
15:10:36FromDiscord<kodkuce> sorry am kind half afk am baking eggs
15:10:43FromDiscord<treeform> eggy?
15:10:47Yardanicopiggy
15:10:51FromDiscord<kodkuce> (edit) "baking" => "paning/frying no oil "
15:10:52disruptekleggy
15:10:54FromDiscord<treeform> piggy is a good one
15:10:58Yardanicotrimmy
15:11:12FromDiscord<treeform> piggy for PI and trigonometry stuff.
15:11:31disruptekbecause who doesn't need another library for that?
15:11:48disrupteksmart people are creepy.
15:12:14FromDiscord<kodkuce> i dident get really your respons for httpasync, basicly you try establish ws connection, my serfer just returns 404 or whatwer but client still think its connected
15:12:17FromDiscord<treeform> good think I is no smart people
15:12:28*Trustable joined #nim
15:12:39FromDiscord<treeform> @kodkuce returning 404 works, I don't think that is what your code is doing.
15:12:40disruptekgood think.
15:13:02FromDiscord<treeform> @kodkuce I think you think its returning a 400. But I don't think so?
15:13:24Zevvdisruptek: https://inside.java/2020/08/07/loomperformance/
15:13:48FromDiscord<treeform> @kodkuce does this case pass for you? https://github.com/treeform/ws/blob/master/tests/test_404.nim How is your case different from that case?
15:15:28FromDiscord<kodkuce> sec
15:15:30disruptekwow, this is a good read.
15:15:34disruptekor maybe i'm just stoned.
15:17:52FromDiscord<treeform> @kodkuce when I run your client I get "Exception message: Failed to Upgrade (Possibly Connected to non-WebSocket url)"
15:17:59FromDiscord<treeform> I think I just need to cut a new version to fix it.
15:18:36FromDiscord<treeform> Websockets can't to HTTP codes as returns, its invalid.
15:18:57FromDiscord<treeform> If you want to do a web failure I recommend doing it as a message.
15:19:05disruptekby fix he means, break your code.
15:19:31FromDiscord<treeform> Send back via websocket some thing like `{"error":"not authenticated"}` then close connection.
15:19:50disruptekwho here has read my source code?
15:19:57FromDiscord<treeform> Not `req.respond(Http400, $(%{"error":"blablasome"}), rheader)` that does not work.
15:20:16FromDiscord<kodkuce> "Websockets can't to HTTP codes as returns, its invalid." <<< i did not know this ๐Ÿ™‚
15:20:23FromDiscord<kodkuce> that is why i asked
15:20:30Yardanicogoogle exists :P
15:20:33Zevvdisruptek: can you think with me for a minute
15:20:40FromDiscord<treeform> @disruptek your source code?
15:20:40disruptekyeah.
15:20:49disruptekoops, i did it again.
15:20:52Zevvopen the stash/echo thingy
15:20:54FromDiscord<kodkuce> but still shoduent this ws faill cuz server did not reposnd
15:20:56disruptekyes yes.
15:21:19FromDiscord<treeform> @kodkuce it fails for me in #head... I can cut a new release
15:21:26disrupteki wanna ask you guys to critique my code later.
15:21:51Zevvfor example, line 186/187
15:21:57disrupteki just realized i have rarely gotten feedback on nim code.
15:22:05ZevvI want 'sockSend()' to do the 'cps evq.io() for me and hide it
15:22:11disruptekyyes yes zevv. and it do.
15:22:15disruptekit do be like that.
15:22:18Zevvdisruptek: we all decided not to talk about your nim code
15:22:24disrupteklol
15:23:14disruptekif i had realized anyone was reading it, i would have typed in more comments.
15:23:35disruptekanyway, talk to me about cps.
15:24:27FromDiscord<kodkuce> Exception message: Failed to Upgrade (Possibly Connected to non-WebSocket url)
15:24:44disruptekyou wanna do it inside the compiler? are you ready?
15:24:46FromDiscord<kodkuce> ye it fails for me too now i am on #head before it just got stuck
15:24:56FromDiscord<kodkuce> whawer then its fixed
15:25:09disruptekpersonally, i am not.
15:25:22Zevvdisruptek: well, as I said above. But I can't do it now
15:25:37ZevvI need a .cps. proc to be able to call a .cps. proc
15:25:47disruptekit will be cps.sockSend(fd, msg) -- what else?
15:26:03disruptekyou are passing the continuation.
15:26:13disruptekwe know the variable, the type, the name of the continuation.
15:26:27disruptekwhere it goes from there... who knows.
15:26:32Zevvwe miss soemthing
15:26:38disruptek(well, we do, because we put where you go on the stack already)
15:26:50Zevvyes
15:26:56disruptekthis is what the inversion of control flow is.
15:27:10Zevvright. So I now make a 'sockSend2()' which is .cps.
15:27:20disruptekyou don't tell us where you're going. we tell you where you've been.
15:27:28disruptekyes yes.
15:27:30Zevvso so
15:27:57Zevvso I make a .cps. proc called sockSend2()
15:28:00disruptekyes
15:28:01ZevvI can do 'return sockSend2()'
15:28:05Zevvbut then there is no more after that
15:28:11Zevvbecause return, well, returns
15:28:16Zevvwe need a return that does not return
15:28:26disruptekno, we are rewriting the return.
15:28:30Zevvright
15:28:32Zevva non-rewritten return
15:28:33disruptekjust as we are rewriting the result.
15:28:34FromDiscord<treeform> @kodkuce new release published, please update your nimble https://github.com/treeform/ws/releases/tag/0.4.2
15:30:33disruptekwhy would we need that?
15:30:39disrupteki think i missed something.
15:30:52ZevvI want CPS procs to be able to call CPS procs
15:30:59Zevvnot only CPS *magic* procs
15:31:04disruptekindeed, that sounds cool.
15:31:10disruptekso what's the problem?
15:31:24FromDiscord<kodkuce> ty ๐Ÿ™‚
15:31:27Zevvwe lack the mechanism
15:31:35disrupteknonsense.
15:31:41Zevv_at this time_
15:31:45Zevvwe need "await"
15:31:55disruptekwhat do you think those .cpsMagic procs are?
15:32:05disruptekit's just nim, man.
15:32:05Zevvprocs that do *not* get rewritten
15:32:22disruptekthere's a kind of nim that isn't rewritten, right?
15:32:29disruptekand it's the same kind that is rewritten, right?
15:32:35disruptekso how can you tell the difference?
15:32:39disruptek/is/ there a difference?
15:33:15disruptekwe decided that cps authors, people that write iterators.. they are willing to learn the dark art.
15:33:38disruptekthe rest of the users... fuck 'em. they don't get the power but they don't get any sharp pointy bits that could take an eye out.
15:33:53Zevvdisruptek: how should I do this: http://ix.io/2tvB/nim
15:34:10disruptekyou just did it, right?
15:34:16Zevvno. it doesn't work
15:34:30FromDiscord<Technisha (LGBTQIAP+)> If i had a string like `" a b c"`, how would i get rid of all of the spaces before `a`?
15:34:34ZevvWhat do I do with the return value of sockSend()
15:34:41ZevvIf I discard it, we lose it
15:34:43disruptekwe don't do anything special for synchronoze calls.
15:34:47disruptekwhat is that, even?
15:34:48Zevvif I return it, we return after "This" and "That" is never reached
15:35:24disruptekdude, remember how this works?
15:35:30ZevvI guess not
15:35:33disruptekif it's a cps call, you put `cps` in front of it.
15:35:39ZevvYeah yeah sure I do that
15:35:44FromDiscord<Yardanico> @Technisha (LGBTQIAP+) strutils.strip
15:35:54FromDiscord<Technisha (LGBTQIAP+)> But then that removes all spacea
15:35:55disruptekokay. 'cause it won't compile otherwise.
15:35:58FromDiscord<Technisha (LGBTQIAP+)> (edit) "spacea" => "spaces"
15:36:05Zevvno, it doesn't compile *with*
15:36:15FromDiscord<Technisha (LGBTQIAP+)> I only want to remove the spaces before `a`
15:36:19disruptekwut
15:36:21Zevvbecause i'm not calling a magic. Wrong proc signature
15:36:26FromDiscord<Technisha (LGBTQIAP+)> So i only have `"a b c"`
15:36:39disruptekmagic isn't a thing.
15:36:41disruptekis it?
15:36:50disrupteki thought we already took it out.
15:36:55ZevvNo, ok, true
15:37:00Zevvbut still. Try to do what I try to do
15:37:03Zevvcall a CPS from a CPS
15:37:04Zevvdo it
15:37:09disruptekmaybe i don't remember.
15:37:14disruptekcan you put this in a test?
15:37:18Zevvsure
15:37:25*clemens3 quit (Ping timeout: 240 seconds)
15:38:16*dulsi quit (Remote host closed the connection)
15:38:30FromDiscord<Technisha (LGBTQIAP+)> :P
15:40:04disruptekZevv: all it does is convenience for the user.
15:40:21disruptekthere's no practical side-effect as far as cps is concerned.
15:40:28FromDiscord<Rika> @Technisha (LGBTQIAP+) read the definition/description of `strutils.strip` again
15:40:35FromDiscord<Technisha (LGBTQIAP+)> Okay
15:41:09disruptekinstead of designing a second api for cps developers, we just make out primary api better.
15:41:26disruptekit's only nim.
15:41:28Zevvdisruptek: https://github.com/disruptek/cps/blob/master/stash/cpscps.nim
15:41:37Zevvtell me what to type on line 22 to make this work
15:41:47ZevvI want the output "one a, two a, two b, one b", right?
15:41:49FromDiscord<Technisha (LGBTQIAP+)> Oh okay, thanks!
15:41:50disruptekokay, lemme see.
15:41:56Zevvwith "sleep" in the middle, btw
15:42:27disruptekand i'm a "cps developer", right?
15:43:12FromDiscord<Technisha (LGBTQIAP+)> How would i get rid of few characters from the start of a string?
15:43:23FromDiscord<treeform> disruptek is a "child protective services developer"?
15:43:29Zevvdisruptek: the docs say "yes, you are"
15:43:32Zevvyou are *The* cps devleoper
15:43:37Zevvbecause no one dares read your code
15:43:41disruptekmany is the protective service i've developed.
15:43:59ZevvI do *use* your code tho. today even, the mangling. I love it
15:44:04*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
15:44:08disrupteknice.
15:44:31ZevvI did get some clashes with stdlib.h, tho
15:44:35disruptekwe should tweak it soonish because it will be something that might be harder to change later.
15:44:45Zevvdisruptek: sure thing
15:44:48Zevvthat's why i'm bringing it up
15:44:55disruptekso we should get it gutten tight.
15:44:59ZevvI just spend a few minutes writing little things I want to write with this stuff
15:45:06Zevvevery now and then
15:45:18Zevvbut you see my problem now?
15:45:41disruptekwell, i'm not looking at the code, but are you saying that no one can use the stuff we have?
15:46:11Zevvfor the basics, but we can't do it all
15:46:33disruptekyou want a dsl to compose iterators.
15:46:46Zevvwell, did you look at cpscps.nim
15:47:00disrupteklemme understand it first.
15:47:49disruptekwhat does it do?
15:48:24disruptekwell, sleep doesn't sleep, right?
15:48:33Zevvok, I can make it do
15:48:37Zevvdoesn't matter
15:48:49ZevvWith the current stuff we can do a few things.
15:49:00Zevv- call a cps proc from normal code. This results in a cont that you have to do something with
15:49:11*pbb joined #nim
15:49:18Zevv- Call a 'magic'/'middleware' proc from a CPS. That does stuff that you don't want to see
15:49:54ZevvBut I can't call CPS from CPS. My 'sockRecv()' needs to be a .cps. proc. But I want to call it from a .cps. proc, not from normal nim
15:50:00disruptekoh i'm such an idiot.
15:50:07Zevvyour words
15:51:29Zevvso, makes sense now?
15:51:45disrupteknope.
15:51:48disruptekholdon.
15:51:56disruptekthe code is working afaict.
15:52:16Zevvno. "one b" never happens
15:52:23disruptekoh.
15:52:36Zevvbecause the return gets rewritten to a returning return that returns
15:52:38disrupteki didn't see that it should.
15:52:51disruptekoh, you want to call two() as cps?
15:52:58ZevvRight'o
15:53:00disruptekjust `cps two()`
15:53:07disruptekthat's how we call cps procs, remember?
15:53:08Zevvtry it
15:53:36disruptekhuh.
15:54:32disruptekit's like a compiler phase issue.
15:54:37Zevvno.
15:54:46Zevv`proc two()` is the bootstrap
15:54:52Zevvit doesn't take a C, because it is ment to be called from *nim*
15:54:54Zevvnot from cps
15:54:56disruptekthis is solved once we're typeed, right?
15:54:59disruptekwe can agree on that?
15:55:01Zevvno
15:55:08Zevvread that ^^^
15:55:08disruptekand why is my keyboard producing so many double letters?
15:55:13disruptekam i slurring my words?
15:55:29Zevvonly the es and the rs
15:55:33disruptekwhat's a bootstrap?
15:55:43Zevvthe initial proc to call cps from nim
15:55:45Zevvlook at the rewrite
15:55:51Zevv`proc two(): C`
15:56:03Zevvthere is no `C` argument. Because you call it from nim, not from cps
15:56:19ZevvI call it a bootstrap, I don't know if you have a name for it
15:56:47disruptekwe'll call it whatever you want.
15:56:47Zevvit's that one particular proc that has the same name as the original
15:56:56disruptekwe're talking about the proc that the user calls "from nim".
15:56:59disruptekright?
15:57:30ZevvI'll call it steve then
15:57:33Zevvright
15:57:34disruptekthat proc just creates our continuation and calls it, right?
15:57:37disruptekthat's what it should do.
15:57:40Zevvright
15:57:43FromDiscord<kodkuce> this watchexec can i run it for just 1 file if i put -f filename.nim it dosent call it ๐Ÿ˜ฆ
15:57:47disrupteki don't think we do all that yet.
15:57:55Zevvbut if you call it from cps, it wants to get a C passed
15:58:23disruptekoh, you redid this.
15:58:32disrupteki totally did not see this.
15:58:40Zevvwhat
15:59:18Zevvanyway, we need generate 2 variants of the `two()` proc
15:59:32Zevvnim will call the right one by signature. One from nim to cps, and one from cps to cps.
15:59:35disruptekwhat's bad about doing stuff in macros?
15:59:42Zevvyour types are a ly
15:59:44Zevvlie
15:59:50ZevvI just want to see that it is a NimNode
16:00:12disruptekokay, whatever.
16:00:15Zevvwhatever
16:00:29ZevvSo, agree? We need to generate `proc foo(): C` and `proc foo(c: C): C`
16:00:39Zevvone is for calling from nim, the other is for calling from cps
16:00:50disruptekfine.
16:01:02Zevvyeah, but you sound like I'm your nagging wife now
16:01:03disruptekbut why?
16:01:25Zevvbecause it doesn't work now?
16:02:58disruptekyou use nim to alloc the continuation. it's a chunk of memory. we just need to get ourselves into its .fn and we're golden.
16:03:02*clemens3 joined #nim
16:03:33Zevvright. So. What I think should be done:
16:03:51Zevvthe first proc you now rewrite, the `proc two(): C` is the special kid in the class. IT doesn't take a C as argument. Right?
16:03:59Zevvso it does a special dance to *make* the C
16:04:04Zevvsay yes or no
16:04:29Zevvit's the one doing the initial allocation of the env
16:04:42disruptekyes.
16:04:52Zevvbut when I call from CPS, I already *have* a anv.
16:04:53Zevvenv
16:04:57disruptekyes.
16:05:02ZevvSo I think we should make two() take an env
16:05:08disruptekthe first one is the bootstrap.
16:05:11Zevvright
16:05:21Zevvso we make two() just normal like all the others
16:05:24Zevvit gets an env
16:05:40Zevvand we make a little bootstrap with the same name, but now C argument. That simply does the alloc and calls he real two()
16:05:45Zevvso then we have both of them
16:05:50disruptekbut i'm saying we have `run`, right? that's the api. so maybe we overload `new` as well.
16:06:11disruptekvar c = new C()
16:06:28Zevvhmm not sure, overloading `new`?
16:06:42Zevvanyway, long story short: you *do* see my current problem
16:06:44Zevvquestion markl
16:07:18disrupteki'm thinking.
16:07:22Zevvgood
16:08:50disruptekyes.
16:08:54ZevvI say: we rewrite two() like any other cps proc into `proc two(c: C): C` and provide a "bootstrap" that is just `proc two(): C = result = env2_14450074(fn: two)`
16:09:10disruptekwhy would it differ?
16:09:18disruptekwe don't "do" entry.
16:09:44disrupteki live my life one .cps. at a time.
16:11:56Zevvok, we need a `proc two(): C`, agree?
16:12:21Zevvbut I also need `proc two(c: C): C`.
16:12:23disruptekyes, but what makes you think it's not a bug that it doesn't exist?
16:12:33disruptekwhy wouldn't it exist? it exists for one().
16:12:33Zevvoh I dont know, is it?
16:12:40disruptekthe two procs are defined the same.
16:12:51disruptekthey should be equivalent in terms of the .cps. macro.
16:13:05ZevvI don't see a `proc one(c: C): C`
16:13:17disruptekit's added by .cps.
16:13:24Zevvdon't see it in the cpsDEbug
16:13:56disruptekargh, lemme try it.
16:14:44disruptekare you on head?
16:15:56Zevvsure
16:16:01Zevvoh diner bbl
16:18:01disruptekit's not added, clearly.
16:18:04disruptekhmm.
16:18:47*dadada joined #nim
16:19:10*dadada is now known as Guest77498
16:22:08*opi quit (Read error: Connection reset by peer)
16:22:22disruptekwe should not write code as developers, we should write code as refactor artists.
16:23:58disruptekdon't guess. the next guy will know. give him a way to refactor you.
16:25:13*matti is now known as kwilczynski
16:25:24*kwilczynski is now known as matti
16:26:15*matti is now known as kwilczynski
16:26:41*jken_ joined #nim
16:30:08*kwilczynski quit ()
16:30:55disruptekZevv: i dunno if it used to work or what, but let's just put it back in.
16:31:01*kwilczynski joined #nim
16:31:08disruptekwe can do it simply and then the next guy can change it.
16:31:25disruptekif our input is nil, we'll alloc it.
16:37:26shashlickanyone knows how to use {.emit.} to run a c function and get a return value
16:38:36disruptekget a return value?
16:38:58disruptekfrom c you can access nim, right?
16:39:05*narimiran quit (Ping timeout: 240 seconds)
16:44:24shashlickhow
16:45:15disruptek.exportc
16:46:43shashlicki'm basically trying to call https://github.com/cmuratori/meow_hash/blob/master/meow_hash_x64_aesni.h#L149
16:47:05disruptekaha, you like meowhash, right?!
16:47:51disruptekso what does it take?
16:47:56disruptekpointers to something?
16:48:10disruptekdo you have that thing in nim? exportc it.
16:48:12shashlickjust hashes, that works fine but since it doesn't return anything, nim gets bothered
16:48:23Zevvdisruptek: It's not a C thing. It's a C preprocesor hing
16:48:29disruptekbothered how?
16:48:38disrupteki know, it's a macro.
16:48:59shashlickhttps://play.nim-lang.org/#ix=2tvL
16:49:22disruptekoh shit, now i see.
16:49:31Zevvshashlick: if you want to go that way, wrap it in a C func and call that
16:49:34disruptekjust use a proc to call what the macro does.
16:50:01shashlickif we can figure this out, nimterop can get macro => template support
16:50:15disruptekwell, use zevv's idea, then.
16:51:00disruptekbut you could have a macro right these templates, too.
16:51:08disruptekwrite, also. yikes.
16:51:25shashlickya macro is fine but how do you get the return value from a c macro
16:51:33Zevvyou don't.
16:51:35ZevvIt's an expression
16:51:36disruptekit's an expr
16:52:02shashlickright and i don't know types to assign it to a var
16:52:16disruptekit wouldn't matter anyway, would it?
16:53:16disruptekyou could just render the values in a macro. that would be cool.
16:54:42shashlickno idea how to proceed - any code tips will be appreciated
16:54:56ZevvI'm not sure how you would handle this. It doesn't exists when it's in the preprocessor
16:55:13Zevvyou can't know types and all.
16:55:26disrupteki know, that's what's so aweome about it.
16:55:39Zevvawkward or awesome?
16:55:43disruptekyou export the symbols you want to use. now you know how to get them from nim.
16:55:50Zevvthere *is* no symbol
16:55:53shashlicki'd rather not use the value cause it could be very complicated
16:56:02disruptekthen you simply render them into strings.
16:56:09Zevvit doesn't exist. It's just a bunch of characters
16:56:15disruptekthe string goes into the source.
16:56:20Zevvwhat source
16:56:20disruptekthe source goes into the compiler.
16:56:23Zevvwhat source
16:56:27shashlicksomehow emit doesn't return anything
16:56:27disruptekc source
16:56:31Zevvwhat c source
16:56:37shashlickthat can be replaced into the if xxx
16:56:43disruptekthat which you emitted.
16:56:45Zevvyeah but there is no c source here
16:56:53Zevvoh the nim c source
16:56:54Zevvhmm
16:56:55Zevvlemme think
16:57:02*superbia1 joined #nim
16:57:10disruptekit's not crazy.
16:57:13*superbia quit (Ping timeout: 264 seconds)
16:57:39Zevvbtw, to get back to the cps thing: will you bring back these nasty constructs with the `whens`, or just generate 2 procs with different signatures?
16:58:17disruptekwe generate one new proc. from the first proc, we call the new proc.
16:58:24Zevvrighto!
16:58:46disruptekbut in the new proc we check if the input is nil.
16:58:50Zevvshashlick: you should ask the guy who made nimterop, I guess he knows a lot about this stuff
16:59:09disruptekif it is, we alloc whatever our via is.
16:59:29Zevvwhy not allocate in the first proc?
16:59:33Zevvyou know you need to alloc there?
16:59:45Zevvit needs to return the C that it didn't get passed
16:59:59disruptekhmm, good point.
17:00:30Zevvmost of my points are good
17:00:30shashlickah you guys gave up already ๐Ÿ˜›
17:00:33Zevvthe rest of them are great
17:00:40disrupteki think it's worth it.
17:00:44Zevvshashlick: no not yet, but I need to keep track of disruptek otherwise he will type stupid stuff
17:01:10shashlickcps can continue run in the background anyway right
17:01:27disruptekwe know a case where we will use this semantic. there may be others. it's not a big stretch. we could use it to scale envs up, for example.
17:01:43disrupteki guess we're calling them envs.
17:04:30disrupteki think we can assume that a nil check on the first arg input to the proc is practically, if not provably free.
17:05:29disruptekwe'll do it your way and fix it when it breaks.
17:07:41Zevvor we'll break it when it's fixed
17:10:36Zevvshashlick: my bet is, if c2nim can't handle it, you're kind of out of luck
17:14:12disruptekmy next project is gonna be some kind of reflection api.
17:14:41Zevvnarcism
17:14:47Zevvcall it
17:16:08disrupteksure.
17:18:04disrupteki want a little bucket i can access by id, like @cache.foo
17:18:28disruptekjust compile-time caching by proc or something.
17:19:23disruptekZevv: you should design some dsl for cps patterns, too.
17:19:29Zevva bucket for monsieur
17:19:52disruptekun petit bucket.
17:20:02Zevvhttps://www.youtube.com/watch?v=Zx0ME65y72E
17:20:16disruptekjust one thin mint.
17:20:53Zevvcps patterns
17:20:56Zevvenlighten me
17:23:07disrupteki dunno, like a syntax for iterators, a syntax for exceptions, etc.
17:23:34Zevvthese are all middleware problems, right
17:23:34disruptekwe should provide some basic generics, right?
17:23:42Zevvnot sure, don't think so yet
17:24:12Zevvit's all dressing up
17:38:51*vicfred joined #nim
17:53:47*natrys quit (Quit: natrys)
18:06:54*waleee-cl joined #nim
18:18:21*superbia1 is now known as superbia
18:19:22*abm quit (Quit: Leaving)
18:29:05*lritter quit (Quit: Leaving)
18:37:18disruptekZevv: why do we disallow a return type?
18:38:16alehander92disruptek https://github.com/mrakgr/The-Spiral-Language/commit/51fe8b7f286590a83db5aa47d1da7fb11a96af56
18:38:19disruptekit's part of #20 {.cps: C.} but i don't understand why.
18:38:21alehander92those are the commit messages
18:38:28alehander92i wanted to show once .. someone
18:38:37alehander92not sure who tho, maybe you guys
18:38:55Zevvdisruptek: elaborate
18:38:59alehander92it reminds me a bit of your chat, if it gets inserted into commits
18:40:10disrupteknah, this guy is a way bigger asshole. i bow to him.
18:40:35disruptekwe say, "No return type allowed for now"
18:41:07alehander92hahaha i don't agree with his sentiment. but the thinking process and effort is pretty interesting to me
18:41:38alehander92i'd like to add a bit of similar discipline. but with more optimism
18:41:52disruptekhe's narcissist. i've a bit fed of with them, lately.
18:41:59disruptekfed up, rather.
18:43:25disruptekoh, we deny return type so that we can make results work.
18:43:28disrupteki forgot.
18:43:38disrupteki will write something about that.
18:46:47disruptekmaybe a void return type means mutation (what else?) and otherwise it means value semantics.
18:47:22alehander92yeah, i like the discipline of writing / working on projects like that
18:47:27shashlickMeowhash gives me different values in streaming mode
18:47:29alehander92not the attitude
18:47:43disruptekshashlick: is that by design?
18:48:09shashlickNo idea, now I need to redo in C to verify if my code is wrong
18:48:19shashlickBut it worked fine with Sha256
18:48:41shashlickDocs are minimal and code unreadable
18:48:54shashlickTheir website is out of sync with the repo
18:49:00Zevvsounds like my life
18:49:04shashlickNot easy peasy
18:49:06disrupteki was going to port from scratch but i realized it could be challenging to get it to replace our existing hashing in stdlib, so i lost motivation.
18:49:33disruptekthe speed is pretty attractive, though.
18:49:54disruptekiirc it's 16b/cyc
18:50:32shashlickIt's all sse4 stuff
18:51:19shashlickSingle header so no reason to port
18:51:59disruptekyeah, but it's not even that long. i'd rather have it in native.
18:52:32disruptekanyway, are there no tests?
18:52:37*ee7[m] joined #nim
18:55:23shashlickAll seem to read file fully into memory
18:55:26Zevvdisruptek: request permission to ask stupid question
18:55:36disruptekyes yes.
18:55:39shashlickNot the streaming api
18:56:00disruptekso the streaming api produces novel results but you have no test for it?
18:56:15disrupteki guess you do need to write a c version.
18:56:41shashlickYa
18:56:50shashlickWay to go
18:57:57*NimBot joined #nim
18:59:03disruptekZevv: do i have to guess?
19:01:54Zevvoh
19:01:55ZevvI forgot
19:01:58disruptekZevv: ah, i took a shortcut and it bit me. that's what happened.
19:02:14Zevvwhat's "saften"
19:02:21Zevvgerman juice making?
19:02:30disruptekthe mutant idea was supposed to be one where you supply the value type, premade, prealloc'd.
19:02:59disruptekthere are a few words that have a silent t and this is one
19:03:04disruptekit's a made-up word.
19:03:14disruptekensafen was taken.
19:03:31disruptekensaferate is available, though.
19:03:44disruptekensaferatoration is available, too.
19:03:49ZevvI'll just read it as german juice making
19:03:56disruptekfair enough.
19:03:59Zevvfrog in a blender
19:04:11disrupteki do have some good news.
19:04:19disruptekbentley and i came to an agreement.
19:04:31disruptekwhen he dies, i won't stuff him and turn him into a throw cushion.
19:04:41disruptekand if i predecease him, he won't eat my face.
19:04:45disruptekwell, not right away.
19:04:54Zevvwhy would you care?
19:04:59Zevvor he
19:05:07Zevvstupid agreement
19:05:10disruptekthe guy is sick.
19:05:19disrupteki say him licking his own asshole last night.
19:05:28disrupteki caught him in the act.
19:05:31supakeenYou don't?
19:05:36disruptekred tongued and with a guilty look on his face.
19:05:50disruptekcall me a prude, but i do that shit in private.
19:06:27supakeenLive a little, disruptek.
19:06:33disruptekyeah, well.
19:06:36disruptekthat's the problem.
19:06:44disruptekhe's seen how i treat the cushions.
19:07:26*muffindrake joined #nim
19:09:46*vicfred quit (Read error: Connection reset by peer)
19:09:47Zevvhm when going typed a few different rules apply
19:09:52Zevvyou can't modify your incoming NimNodes
19:09:58*vicfred joined #nim
19:10:06Zevvneed to build a new tree
19:10:11disruptekthat's fine.
19:10:20disruptekthe only issue is copying gensyms.
19:11:15disrupteki'll patch this for the current impl and we'll rewrite it in the typed version.
19:11:25Zevvsure
19:11:33disrupteki mean, it's pretty important that it works. ๐Ÿ˜‰
19:12:32Zevvworks is overrated
19:22:36disruptekfoo(): Cont returns a Cont which is fully allocated and ready to run. you c() and it procedes with the trampoline, starting with foo(Cont): Cont. i think that's pretty tight, right?
19:29:09*dulsi joined #nim
19:30:25disruptekor should it just run the first leg of the continuation, too?
19:39:26*endragor_ joined #nim
19:40:53FromGitter<jivank> What would be the best way to call C code? Essentially I just want to call the main of this https://github.com/Rudde/mktorrent
19:41:44FromGitter<jivank> and I assume nim would embed everything it needs (still will compile to a single binary)
19:42:24*endragor quit (Ping timeout: 256 seconds)
19:47:04Zevvhmmm that's a good point.
19:47:15ZevvI think *not* do the initial tramp
19:47:28Zevvbecause if you do that and you don't want that, there's no way not do it
19:47:33disruptekright.
19:47:36Zevvbut if you don't do it and you want it anyway, you *can* do it
19:48:03Zevvso the middleware can chose to do that if it makes sense
19:48:45disrupteki mean, they can always be run. the middleware can choose what to do, if anything.
19:48:53Zevvexactly
19:48:58disruptekyou have a fresh object.
19:49:03disruptekit's not like you cannot test for this.
19:49:21Zevvpush that shizzle
19:49:29disruptekwe could give you some kind of initialization.
19:49:39Zevvlike how
19:49:47disrupteki added this for trace but i would want it be nicer if it were general.
19:50:22disrupteklike we call you with (nil.Cont, c: Cont) and you overload that to do initialization.
19:50:53Zevvhmmm. it sounds plausible, but I do not have a practical use case for that yet, I think
19:51:18disruptekwell it doesn't work yet. i am doing something dumb.
19:52:56disruptekoh because i assume too much.
19:56:34*jken_ quit (Ping timeout: 256 seconds)
19:59:58Zevvand now your AST is ill formed
20:00:05Zevvthat's quite a nasty thing to say
20:00:24disruptekjust pushed. somehow i'm wiping the return type and not restoring it.
20:00:28ZevvYo mama's so fat her AST is ill formed
20:01:32disruptekwe have to always insert it, right?
20:01:41disruptekelse how can you merge two continuations?
20:02:18Zevvhm let me see. "merging two continuations"
20:02:51disruptekpoint is, you have to be able to pass more than one.
20:03:04Zevvhow so?
20:03:10Zevvthere is always only one?
20:03:19Zevvyou can't go two places
20:03:22disruptekthat's rather sad.
20:03:30Zevvit's the way of the world
20:03:37disruptekwell, the way of the world sucks.
20:03:48Zevvso I've heard
20:04:55disruptekthe crows are feasting tonight.
20:07:27ZevvI just found back on old CD I forgot about for 20 years. nostalgia galore.
20:07:41Zevvsuddenly I'm there programming turbo C and playing quake
20:07:48disruptekbeck?
20:07:51ZevvOrbital
20:08:19ZevvI bet they never made it to the usa
20:08:22disruptekorbital.
20:08:46disrupteki don't know them.
20:08:55Zevv"In Sides" is the album
20:09:30disruptekit's freaking bentley out.
20:09:40Zevvit should.
20:09:46Zevvstart at #3
20:09:48zedeuspoor dog
20:10:13Zevvso, echo server is not happy now
20:10:17Zevvbut you probably noticed
20:10:32disrupteki try not to run tests.
20:10:39disrupteki'm all about my testes, now.
20:10:42Zevvgood
20:12:19disruptekgah, time for line numbers on this debugging output.
20:12:34Zevvlike, the original source line numbers?
20:12:36disruptekprobably should just write a proper logging interface.
20:12:38disruptekyeah.
20:13:04Zevvdid I accidentally check in the treerepr
20:13:06Zevvor was it you
20:13:11disruptekme.
20:13:13Zevvok
20:17:08*vicfred quit (Quit: Leaving)
20:17:32*MightyJoe quit (Ping timeout: 256 seconds)
20:17:45*cyraxjoe joined #nim
20:19:18disruptekit's pretty fun to listening to everyone's music on this channel.
20:23:08ZevvI miss your streams
20:23:12ZevvI hated the babbling, tho
20:23:28disruptekyeah. it was hard to work sometimes.
20:25:29disrupteki think we have to go typed now.
20:28:45Zevvlike, *now*?
20:28:51ZevvI was just about to get some breakfast
20:28:57disruptekbreakfast?
20:29:03disruptekfor second dinner?
20:29:08Zevvfirst breakfast
20:29:18disruptekwhere are you?
20:29:21Zevvcereals make for an appropriate meal any time of the day
20:29:24*narimiran joined #nim
20:29:37Zevvand go great with Talisker
20:29:59disruptekeggs, too. i'm pretty much always down to slurp up half a dozen hen's periods.
20:30:36*kenran joined #nim
20:32:22Zevvgood thing they debunked the cholstrol story, right
20:32:38disruptekbunch of bs.
20:33:47disruptekfocus on the cereal. we can't have you on talisker until we've weathered the milk-coma storm.
20:34:09Zevvtoo late
20:39:03Zevvjerk
20:39:08Yardanicobaka*
20:39:28disruptekheh
20:40:32Zevvone reason I took the cps code out of the macro: I was planning to make macros in middleware
20:40:37Zevvlike .coroutine.
20:40:44disruptekmakes sense.
20:40:48Zevvwhat would do cpsXfrm(MyCoroType, fn)
20:41:09disrupteki just want that as normal syntax.
20:41:19Zevvand my reasoning is: don't do in a macro what you can do in a proc
20:41:23Zevvyeah I want that too
20:41:58disruptekisn't that what -> is about?
20:42:43Zevvwe'll see, we'll see.
20:43:15ZevvI decided to take the pragmatical route
20:43:35Zevvphilosiphy is fine and all, but that doesn't bring usable code on the table
20:43:35disruptekwell, why don't we just recurse directly in cpsXfrm then?
20:44:18ZevvI wasn't sure if it makes sense to transform nested procs
20:44:24Zevvso now it only picks up top level
20:44:45Zevvmy goal is to put my whole source file under .cps. one day
20:44:50Zevvand only have the procs transformed that need to
20:44:55disruptekwell, do it, then.
20:45:05Zevvyeah I know I know
20:45:14disruptekwe'll make it work. it's no big deal.
20:45:26disruptekit's not like we don't have 0.0.13.
20:45:57Zevvbut make sure to finish this before nim 2.0
20:46:02Zevvbecause we need to rewrite half of the stdlib
20:46:24disruptekit's not a problem.
20:46:56disruptekwhen it goes into the compiler, it will cost almost nothing.
20:47:43Zevvsure
20:50:01disrupteki have to try to figure out how to get internet in this $godforsaken wilderness.
20:50:39disruptekgot an opportunity to move to a camp on the side of a lake.
20:50:51disruptekbut, i may have to shit in a hole for a few months.
20:54:44ZevvId shit in a hole
20:54:47shashlickugh - addr data instead of data was the bug
20:54:48Zevvas long as i had good internet
20:54:53shashlickwaste of half a day
20:55:07disruptekouch, shashlick
20:55:19shashlickokay so at least my code works
20:55:19Zevvwlel, you learned something new
21:01:23FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2twN
21:01:40Yardanicodon't trust the "ide"
21:01:46Yardanicogive us what the nim compiler says to you :)
21:03:19FromDiscord<Ricky Spanish> ok so firstly no warning at all when i dont use the build api example and i can use my library with nimble develop, with the examples code i get the line ``` Nothing to build. Did you specify a module to build using the `bin` key in your .nimble file?``` which is strange because im not trying to make a binary im trying to make a regular library that includes just a header and a dll downloaded from url
21:04:21FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2twQ
21:08:40*kenran quit (Remote host closed the connection)
21:08:49*vicfred joined #nim
21:11:35*solitudesf quit (Ping timeout: 256 seconds)
21:11:56*oddp quit (Ping timeout: 256 seconds)
21:12:46disruptekshashlick: when can i improve meowhash?
21:12:49disrupteker, import
21:12:55disrupteki don't want to improve it. ๐Ÿ˜
21:13:23*oddp joined #nim
21:16:48shashlickwill post it shortly
21:16:51shashlicknow that it works
21:23:11shashlickheh doesn't work again - might be an issue with file binary mode
21:23:23shashlickusing open() on a file
21:27:12*arecacea1 quit (Remote host closed the connection)
21:28:00*arecacea1 joined #nim
21:38:38*narimiran quit (Ping timeout: 260 seconds)
21:40:57shashlicklooks like nim already opens files in binary mode
21:45:37shashlickdisruptek: https://gist.github.com/genotrance/bf4b389bc61b618cf53c727a0e55c44b meow hash wrapper
21:51:59*dulsi_ joined #nim
21:54:49*dulsi quit (Ping timeout: 264 seconds)
21:55:02disrupteksweet. i will try to put this into some stuff.
21:55:58shashlickwe can repo it if needed
21:56:11disruptekturns out i have a repo from before. i will put you on it.
21:57:23*dulsi_ is now known as dulsi
21:57:30disruptekhah, it's empty
21:57:58disruptekit took 6 mos to make one commit.
21:58:30shashlickneat
21:59:03disruptekhow is the speed?
21:59:06*vicfred quit (Quit: Leaving)
21:59:23shashlickhttps://github.com/genotrance/autodup is my current focus - cleaning up my dad's photo collection
21:59:32shashlickam about to try that now
21:59:40disrupteki have a parent like that.
22:00:14shashlickit worked well, used sha256 with async and threads but asynctools doesn't work anymore
22:00:20shashlickso moving to weave and sprucing it up a bit
22:00:25disruptekwhy doesn't it work?
22:01:08disruptekmaybe you should try cps. this is kinda what it's for.
22:01:47shashlicki'd like that - basically hashing can be done async
22:01:59shashlickbut cps needs to allow io without blocking
22:02:09disruptekof course.
22:02:35shashlickcan you look at autodup - quite short
22:02:55disruptekyeah.
22:04:31disruptekthis is really interesting.
22:04:55disrupteki mean, it will be a great test of cps to outperform weave's channel passing.
22:05:05disruptekdoesn't it have a copy-free version?
22:05:37shashlickweave just uses nim's channels
22:05:46disruptekalways?
22:05:52disruptekweird.
22:10:26leorize[m]didn't mratsim wrote a special Channel type for weave?
22:10:40disrupteki think he wrong a few.
22:10:43disruptekwrote, too.
22:11:20disrupteki have to look at it more closely. it hasn't been a thing i've had a use for.
22:19:26*arecacea1 quit (Remote host closed the connection)
22:20:20*arecacea1 joined #nim
22:26:59*Trustable quit (Remote host closed the connection)
22:33:22*Jjp137 quit (Quit: Leaving)
22:42:55*Jjp137 joined #nim
22:55:52*waleee-cl quit (Quit: Connection closed for inactivity)
23:10:18*tane quit (Quit: Leaving)
23:28:06*endragor_ quit (Remote host closed the connection)
23:33:01*aenesidemus quit (Read error: Connection reset by peer)
23:33:08*endragor joined #nim
23:56:23*opal quit (Ping timeout: 240 seconds)
23:57:33*vicfred joined #nim
23:58:17FromDiscord<Varriount> @disruptek What's the performance of CPS currently like?
23:58:17*opal joined #nim
23:58:18*Jesin quit (Quit: Leaving)
23:58:48disrupteki dunno what to compare it to.
23:59:20disruptekzevv's echo server does about 150k tps in a single thread.