<< 11-06-2020 >>

00:16:12FromDiscord<Arend | ᛗᚨᚢᚱᛁᛖᛋ> what is the process like for creating another compilation target (like the current C, C++, JS)?
00:18:02*FromDiscord quit (Remote host closed the connection)
00:18:17*FromDiscord joined #nim
00:35:33*giaco joined #nim
00:36:57giacoI was looking for a new language after years of python. I need something to compile and distribute binaries, instead of pyinstaller. I've spent the last 4 days in grasping the basics of go and rust, and now I want nim
00:41:52*rockcavera quit (Remote host closed the connection)
00:42:03FromDiscord<Elegant Beef> Nice
00:42:04FromDiscord<Elegant Beef> Nim is nice
00:42:16FromDiscord<Elegant Beef> That's what the nice in nim is short for... wait it's not there but it should be 😄
00:42:56FromDiscord<Shucks> Coming from go/python. Nim feels awesome.
00:43:07FromDiscord<Shucks> even without goroutines ;D
00:43:36FromDiscord<Elegant Beef> the name goroutines hurt
00:44:28FromDiscord<Elegant Beef> in go do they name for loops gopher
00:45:04giacowell, gophers are go enthusiasts
00:45:09giacoand also rodents
00:45:54giacohow can nim transpile to different languages without being built on llvm?
00:57:15zedeusnim doesn't "transpile", it compiles
00:57:23zedeushow can C "transpile" to assembly without being built on llvm?
00:58:43*rockcavera joined #nim
01:04:12*chemist69 quit (Ping timeout: 260 seconds)
01:06:16*chemist69 joined #nim
01:06:44giacozedeus: wait a second, isn't nim outputting C, C++ or JavaScript code (to be further processed in first 2 cases)?
01:11:46zedeusindeed, but the code it outputs is considered lower level than the Nim code (and handwritten code in those languages)
01:12:57FromDiscord<Rika> i like to think that transpiling isnt a word
01:13:15FromDiscord<Rika> if you think about it, there isnt really enough difference between compilation and transpilation
01:13:15zedeustranspiling usually refers to translating one language to another of equal or very similar abstraction levels, that is from one high-level language to another, such as Python's 2to3 or TypeScript to JavaScript
01:14:27zedeusbesides, Nim does have an LLVM backend, and calling Nim -> LLVM IR transpiling is obviously wrong
01:26:51disruptekis it?
01:26:55FromDiscord<Technisha Circuit> What's the best way to store data simply in Nim? Json?
01:27:08disruptekit seems reasonable to draw a distinction between code that runs on hardware and code that doesn't.
01:30:01FromDiscord<Rika> so would you call "Nim -> LLVM IR" transpiling?
01:30:20FromDiscord<Rika> or you can change it to rust too
01:30:32FromDiscord<Avatarfighter> Would it still not be called compiling?
01:30:51FromDiscord<Rika> it -> ?
01:30:56FromDiscord<Rika> what do you refer to when you say it
01:31:14FromDiscord<Avatarfighter> Sorry I was referring to Nim -> LLVM IR
01:31:22FromDiscord<Elegant Beef> @Technisha Circuit store data in nim or with nim
01:31:30FromDiscord<Elegant Beef> Cause the best way to store data in nim is making constants
01:31:33FromDiscord<Elegant Beef> 😄
01:31:46zedeuswhen compiling you go down the abstraction ladder, when transpiling you don't
01:32:03FromDiscord<Rika> @Avatarfighter with what dsrptk said it wouldnt, since LLVM IR doesnt run on hardware, no?
01:32:23FromDiscord<Avatarfighter> Well LLVM is still a machine
01:32:31zedeusassembly isn't really machine code, either
01:32:43FromDiscord<Elegant Beef> I've got a solution, dont care about the term, just do it 😄
01:33:34FromDiscord<Avatarfighter> @Rika imo i think its compiling bc its running on the hardware provided by the vm that is LLVM
01:33:50FromDiscord<Avatarfighter> Wait is it a vm?
01:33:53FromDiscord<Elegant Beef> So then C#/Java are compiled languages?
01:34:00zedeusyes
01:34:12FromDiscord<Avatarfighter> I would think so
01:34:23zedeusJava is a compiled programming language, but rather than compile straight to executable machine code, it compiles to an intermediate binary form called JVM byte code. The byte code is then compiled and/or interpreted to run the program.
01:34:39FromDiscord<Rika> i always thought java and C# were compiled
01:34:43FromDiscord<Technisha Circuit> > @Technisha Circuit store data in nim or with nim↵With Nim :P
01:34:43zedeusthey are
01:34:53FromDiscord<Technisha Circuit> Java is a mix of interpretation and compilation
01:35:00FromDiscord<Avatarfighter> imo compiling is the translation of high level code to low level bytecode while transpiling is the conversion of syntax from one high level language to another
01:35:06FromDiscord<Technisha Circuit> It's not fully compiled or interpreted
01:35:11FromDiscord<tyler569> it's a fuzzy line though - python compiles to bytecode too but no one calls that a compiled languages
01:35:12FromDiscord<Technisha Circuit> Well
01:35:12FromDiscord<tyler569> (edit) 'languages' => 'language'
01:35:17FromDiscord<Technisha Circuit> That's how i see it
01:35:21FromDiscord<Elegant Beef> I was just asking cause i know they get converted to to their runtime supported code, so was curious where the line is drawn
01:35:23FromDiscord<Technisha Circuit> That's also true
01:35:24FromDiscord<Rika> i dont use "transpiling" for that, i use "conversion"
01:35:32FromDiscord<Elegant Beef> Well tehn tech just use any file format you like
01:35:32FromDiscord<Avatarfighter> @tyler569 i believe that’s due to how its not running in a VM
01:35:39FromDiscord<Technisha Circuit> Okay then :P
01:35:39FromDiscord<tyler569> it is on a VM though
01:35:40FromDiscord<Elegant Beef> Json,toml, custom, yaml
01:35:44giacozedeus: your way of thinking basically narrows down "transpilation" to zero cases. It is not possible to move from a language to another without moving on the abstraction ladder
01:35:44FromDiscord<Technisha Circuit> ~~xml~~
01:35:47FromDiscord<Rika> python is on a VM
01:35:48FromDiscord<Technisha Circuit> Custom as in?
01:36:00FromDiscord<tyler569> python is exactly as compiled as Java except that the "compilation" happens automatically when you run a script
01:36:01zedeusgiaco: false, I already gave two examples
01:36:01FromDiscord<Technisha Circuit> My ownM
01:36:02FromDiscord<Elegant Beef> Your own defined file format
01:36:05FromDiscord<Technisha Circuit> (edit) 'ownM' => 'own?'
01:36:07FromDiscord<Technisha Circuit> Oh okay
01:36:12zedeusthere are many programs that conver one high level language to another
01:36:16zedeusconvert*
01:36:34FromDiscord<Rika> tyler: the only reason people dont call python compiled is because its VM is slow 😛
01:37:07zedeushttps://github.com/jacereda/py2nim
01:37:18FromDiscord<Avatarfighter> Actually I believe its called interpreted bc the python vm is called the interpreter
01:37:24FromDiscord<Avatarfighter> Im trying to confirm my theory rn
01:37:28zedeushttps://github.com/bung87/ts2nim
01:37:30FromDiscord<Rika> ah, really? i see
01:38:22FromDiscord<Rika> i dont get this argument anymore
01:38:29FromDiscord<Avatarfighter> here is a different and way better explanation https://stackoverflow.com/questions/441824/java-virtual-machine-vs-python-interpreter-parlance
01:38:40FromDiscord<Rika> compilation is just translation of code right? so wouldnt transpiling and compiling be conceptually the same
01:38:45FromDiscord<Avatarfighter> nono
01:38:57zedeusit's a semantic difference, not a practical one
01:38:59FromDiscord<Avatarfighter> compile is moving from high level code to low level representations
01:39:16FromDiscord<Avatarfighter> transpile is the translation of one high level language to another
01:39:19*oddp quit (Ping timeout: 260 seconds)
01:39:39giacozedeus: I stand on my point. If you state that transpilation is a "sideway move" on the abstraction ladder, it means that to you ts, python and nim are all on the same abstraction level, which is not
01:39:43FromDiscord<Avatarfighter> i think that makes the most sense but the language I used is debatable
01:40:03FromDiscord<Elegant Beef> I think the difference is quite moot
01:40:17FromDiscord<Avatarfighter> yeah no for sure its a bit iffy but w/e
01:40:20FromDiscord<Rika> `The reason "virtual machine" is a more common term in Java and "interpreter" is a more common term in Python has a lot to do with the major difference between the two languages: static typing (Java) vs dynamic typing (Python).` ↵oooh
01:40:23zedeusgiaco: they may not be the exact same abstraction level, but it that is your point then you don't have a definition of transpilation that is useful
01:40:27zedeusif that*
01:41:33zedeuspython is very high level, nim is also (generally) very high level, C is not. python -> nim is transpilation, nim -> C is compilation
01:41:51FromDiscord<Elegant Beef> Well the trans part of compile means to move from one to another, and compiling means converting into machine code
01:42:02FromDiscord<Elegant Beef> of transpile*
01:42:11giacozedeus: that's why I said that following strictly your logic would narrow down "transpilation" to zero cases. But yes, I thing we're pointing the same thing. Transpilation is the fuzzy process of going from a high level language to another
01:42:23FromDiscord<Elegant Beef> So the difference is simply whether you moved to a different language or machine code
01:42:24FromDiscord<Technisha Circuit> How would i make it so i don't have to recompile some code to use it in my program without linking?
01:42:45FromDiscord<Technisha Circuit> I need to be able to load the code dynamically
01:42:46zedeusto add to that, you can also consider the "translation level". Nim doesn't spit out human-readable idiomatic C code, it's not even ANSI compliant
01:43:12FromDiscord<Technisha Circuit> And I don't think NimScript is gonna help unless there's a tutorial on interacting with Nim and NimScript
01:43:21FromDiscord<Technisha Circuit> (edit) 'And I don't think NimScript is gonna help unless there's a tutorial on interacting with Nim and NimScript ... ' => 'And I don't think NimScript is gonna help unless there's a tutorial on interacting with Nim and NimScripttogether'
01:43:28zedeusyou can use hotcode reloading
01:43:30FromDiscord<Elegant Beef> And the definition of compile from oxford is even more compllicated↵> to translate instructions from one computer language into another so that a particular computer can understand them
01:43:33FromDiscord<Technisha Circuit> There us, isn't there
01:43:35zedeushttps://nim-lang.org/docs/hcr.html
01:43:45FromDiscord<Technisha Circuit> Oh thanks!
01:45:06FromDiscord<Technisha Circuit> Hm
01:45:07FromDiscord<Elegant Beef> Well merriam-webster has this to say about a compiler and therefore compiled↵> a computer program that translates an entire set of instructions written in a higher-level symbolic language (such as C) into machine language before the instructions can be executed
01:45:09giacozedeus: thanks for the answer :)
01:45:30FromDiscord<Technisha Circuit> I want the code to be compiled once and not need to be recompiled until there's a change in the code though :)
01:45:33FromDiscord<Technisha Circuit> (edit) ':)' => ':/'
01:45:50FromDiscord<Elegant Beef> Sounds like you want a high level scripting language
01:45:59FromDiscord<Elegant Beef> 😄
01:46:04zedeusthen you gotta wait for incremental compilation
01:46:22disruptekit'll be a long wait.
01:46:28zedeuswell worth it.
01:46:30FromDiscord<Elegant Beef> Based off their previous comments im uncertain which they want
01:46:30FromDiscord<Technisha Circuit> Oof
01:49:01disruptekthe nim compiler could be faster, but there are very few programs known that don't compile quickly.
01:49:05FromDiscord<Technisha Circuit> Basically i want to be able to:↵A) Be able to use modules that the Nim VM can't use↵B) Be able to have a command per file system where each file is compiled but doesn't need recompiling unless there is an edit in the source code↵C) Have the ability to load, unload and reload the commands
01:49:34disruptekwhy? are you actually coding something now?
01:50:00FromDiscord<Elegant Beef> Well you could always abstract the procs you want then use a scripting language to create the nim side data types and use the procs you want
01:50:05giacoI've just found nim and it is quite dark magic to me. Which other programming languages do exists than can span from backend to frontend and capable of building self contained binaries?
01:50:43disruptekthere are a few packages that keep binaries for you so that they /feel/ like scripts but are actually based upon binary runtimes.
01:51:07disruptekwhat do you call /backend/ and what do you call /frontend/?
01:51:14FromDiscord<Technisha Circuit> > why? are you actually coding something now?↵Yes, I'm making a discord bot with a command handler with separate files, but I don't want to keep compiling the code each time i run the bot :p
01:51:30disruptekwhy would you?
01:51:37FromDiscord<Technisha Circuit> Wdym?
01:51:49disruptekwhy would you recompile code unless it has changed?
01:52:27FromDiscord<Technisha Circuit> For example the main.nim file might've changed, but the separate files might've not changed at all, it'll all get recompiled anyway though
01:52:34zedeusnim doesn't recompile programs that didn't change
01:52:57FromDiscord<Technisha Circuit> > For example the main.nim file might've changed ...
01:53:03FromDiscord<Technisha Circuit> :p
01:53:10FromDiscord<Rika> The top row of my keyboard broke...
01:53:23disruptekthen it's wise to recompile it if you want a binary that expresses those changes.
01:53:32zedeusthe actual solution to this problem is to stop compiling things on your phone.
01:54:01FromDiscord<Technisha Circuit> You know I can't do that XD
01:54:12disrupteki don't recommend using hot code reloading or plugins; they don't seem worthwhile to the task.
01:54:13FromDiscord<Technisha Circuit> Also my phone is getting laggy while compiling Nim from source
01:54:31disruptekfocus on making your software work. then make it correct. then make it fast.
01:55:03FromDiscord<Technisha Circuit> It does work and idk what you mean by correct
01:55:10FromDiscord<Technisha Circuit> Minimize the bugs?
01:55:12FromDiscord<Elegant Beef> Remove the bodges and refactor
01:55:17FromDiscord<Technisha Circuit> Oh
01:55:22disruptekreduce the amount of code.
01:55:33disruptekwhile making it more expressive.
01:55:43FromDiscord<Technisha Circuit> Okay then :p
01:55:52FromDiscord<Elegant Beef> It's hard to write clean code when you dont know where the code will go
01:55:54FromDiscord<Elegant Beef> 😄
01:56:10FromDiscord<Elegant Beef> I might need this, oh wait i dont need this anymore
01:58:01FromDiscord<Technisha Circuit> :p
01:58:34FromDiscord<Technisha Circuit> It's also hard when you are working with 2 other people who have different styles of writing code :P
01:58:40FromDiscord<Technisha Circuit> (edit) 'It's also hard when you are working with 2 other people who have different styles of writing code ... :P' => 'It's also hard when you are working with 2 other people who have different styles of writing codefrom you'
01:58:59disruptekdo they not have arson where you live?
01:59:34giacocan you list for me the "quasi-alternative(s)" to nim that you know? I'm googling dart and haxe
01:59:57disrupteki would say that compilation involves a loss of information, too.
02:00:06disruptekinformation that is not useful to the computer.
02:00:38disruptekie. to reverse the process requires injecting new information.
02:00:40FromDiscord<Technisha Circuit> > do they not have arson where you live?↵?
02:00:51disruptekburn their fucking houses to the ground.
02:01:01FromDiscord<Technisha Circuit> Uhhhhhhh
02:01:29FromDiscord<Technisha Circuit> @codic @Synth
02:01:36FromDiscord<Elegant Beef> A single project should have a single convention
02:01:45FromDiscord<Elegant Beef> If it doesnt everyone learn how to fucking follow a convention
02:01:51FromDiscord<Technisha Circuit> Where do you guys live I'ma burn your houses down-
02:01:53FromDiscord<Technisha Circuit> xD
02:02:01FromDiscord<Technisha Circuit> Read from https://discord.com/channels/371759389889003530/371759389889003532/720456915561480296 down
02:02:03FromGitter<deech> Is there a way of getting a static analysis tool like DrNim to work with a package manager so I could run it on my project and al it's dependencies?
02:02:46disruptekthere's talk of making it work with system-provided z3 library, if that's what you mean.
02:02:49FromDiscord<Synth> WHat happened?↵=
02:02:53*aeverr quit (Read error: No route to host)
02:02:57FromDiscord<Synth> > @codic @Synth↵@Technisha Circuit What happened?
02:03:05FromDiscord<codic> I'd say probably https://discordapp.com/channels/371759389889003530/371759389889003532/720457493867790379
02:03:07FromDiscord<Technisha Circuit> > Read from https://discord.com/channels/371759389889003530/371759389889003532/720456915561480296 down
02:03:07*chemist69 quit (Ping timeout: 260 seconds)
02:03:13FromDiscord<codic> ^^ nvm
02:03:21FromDiscord<Technisha Circuit> xD
02:03:22FromDiscord<Elegant Beef> Im sure IRC loves all these links guys
02:03:25FromDiscord<Synth> ;-;
02:03:26disrupteknot really sure which package manager you're refering to.
02:03:28*Tlanger quit (Quit: Leaving)
02:03:28FromDiscord<codic> What do you mean different styles?
02:03:32FromDiscord<Technisha Circuit> I'm sure they do :3
02:03:36*aeverr joined #nim
02:03:49FromDiscord<Technisha Circuit> We have different styles writing the code as in we write it differently
02:04:00FromDiscord<codic> Yes, I'm not dense
02:04:08FromDiscord<codic> I mean, what specifically are you referring to
02:04:41*chemist69 joined #nim
02:04:51FromGitter<deech> disruptek, I mean I'd like to write my own static analysis tools and run them on my project and know where to find the sources for all it's deps.
02:05:33disruptekwell, i know you won't use nimph, but it does export every proc you might want to use to handle dependency discovery, etc.
02:05:40FromDiscord<Technisha Circuit> Synth uses 4 indents and does `var name: string`, you rarely use `let` or when you do, you avoid `const` no matter what
02:05:53FromDiscord<codic> I do use let and const
02:05:56FromDiscord<codic> I definetely don't avoid them
02:06:03FromDiscord<Technisha Circuit> You use let over const :P
02:06:22FromDiscord<Elegant Beef> Oh no explict types, god the code base will suffer! 😄
02:06:27FromDiscord<Technisha Circuit> I use const where possible so the variable is defined at compile time :P
02:06:36FromDiscord<Technisha Circuit> I use explicit types too
02:06:42FromDiscord<Technisha Circuit> :P
02:06:43FromDiscord<codic> Usually, because most of the code i write with constants is dynamic, I WANT IT TO BE RUNTIME, DO YOU UNDERSTAND THAT?
02:06:48FromDiscord<codic> !!.toLower()
02:06:58FromDiscord<Technisha Circuit> Nah, I don't
02:06:59disruptekwhoa
02:07:03FromDiscord<Technisha Circuit> xD
02:07:07FromDiscord<codic> hey i did say `!!.toLower()`
02:07:14FromDiscord<codic> even though that's not valid nim
02:07:23FromDiscord<codic> more of a combination of bash and nim
02:07:25FromDiscord<Technisha Circuit> I need to burn their houses down, you're right disruptek-
02:07:29FromDiscord<codic> Sure
02:07:33FromDiscord<codic> Have good luck finding me
02:07:34disruptekBTDT
02:07:58FromDiscord<Technisha Circuit> Hahaha
02:08:05FromDiscord<codic> Stop the arson
02:08:09disrupteklook for the girl standing on her roof with a hose in hand.
02:08:12FromDiscord<codic> Stop the murder, the horrible murder
02:08:13FromDiscord<codic> Wtf
02:09:08FromDiscord<Technisha Circuit> :P
02:09:17FromDiscord<Elegant Beef> Im amazed 3 people cant talk and design about the practises and paradigms they're working on
02:09:37FromDiscord<Technisha Circuit> Wdym?
02:09:57FromGitter<deech> disruptek, why do you say that? I've been looking at it.
02:10:08FromGitter<deech> It's a nice project.
02:10:32FromDiscord<Elegant Beef> Im commenting on the fact you an issues with the other people you're working with
02:10:41FromDiscord<Elegant Beef> you have issues*
02:10:46disrupteki dunno, i feel like i've recommended it a few times but you've resisted because it's not the de facto pm.
02:11:33disruptekgiaco: i can give you some languages that are comparable in scope, but i cannot recommend a language that does what nim does better. if i could, i wouldn't be here.
02:12:24disruptekgiaco: also, what platform are you developing for?
02:13:16FromGitter<deech> disruptek, my apologies, you're right my reflex is to stick with the de facto thing. But nimph is definitely nice and I have been looking at it.
02:13:36*Tyresc quit (Quit: WeeChat 2.9-dev)
02:13:43disruptekwell, i've added some bugs to the tracker recently. please let me know if i missed anything. 😉
02:13:53disruptekand, thanks for checking it out.
02:14:17*muffindrake quit (Ping timeout: 272 seconds)
02:14:17disruptekit needs more users but it's so annoying to use right now because of the nimscript/config changes.
02:14:29disruptekslower and spammier than it used to be...
02:14:56giacodisruptek: long story short, I'm a python developer, I've been doing everything with python for the last 6 years. Now I need to create binaries for embedded devices (rpi as a starter) and I'd like to avoid going back to C/C++
02:15:18giacodisruptek:do you have any opinion on haxe, or dart, or red?
02:15:50FromDiscord<Technisha Circuit> > Im commenting on the fact you an issues with the other people you're working with↵@Elegant Beef nah, we are just such good friends that we annoy eachother alot
02:16:00disruptekdart is dead afaik, haxe is not focused enough imo. i don't know red.
02:16:03FromDiscord<Technisha Circuit> Also, my special irl talent is pissing people off
02:16:13*muffindrake joined #nim
02:16:18disruptekwe have a guy here that came from haxe. it's pretty esoteric, still.
02:16:52FromDiscord<Technisha Circuit> Has anyone made another backend for Nim that isn't based off of JS, C, C++ or ObjC?
02:17:03FromDiscord<Technisha Circuit> (edit) 'JS, C, C++' => 'JS' | 'ObjC?' => 'something?'
02:17:12FromDiscord<Technisha Circuit> I'm just curious
02:17:13disruptektarging rpi eliminates most competition. i'd say rust is probably the only language i would consider, and i am not really a fan of rust's ergonomics.
02:17:17FromDiscord<Synth> I use const whenever I can :p
02:17:44FromDiscord<Synth> It replaces the constant vars on compile time so it's your code will run faster if you use const than var
02:17:45FromDiscord<Technisha Circuit> Synth is a good boy
02:17:46disrupteki write a lot of code, so i need to be able to read a lot of code. i would rather read nim.
02:17:50FromDiscord<Synth> No, you're silly
02:18:13disruptekthere's an llvm ir backend.
02:18:14FromDiscord<Technisha Circuit> You are though
02:18:21FromDiscord<Technisha Circuit> Oh?
02:19:09FromDiscord<Elegant Beef> If you dont like rust use nim
02:19:16FromDiscord<Elegant Beef> Problem solved 😄
02:21:07giacodisruptek: I don't follow your "targing rpi eliminates most competition. i'd say rust is probably the only language i would consider".
02:21:36giacodisruptek: are you saying that nim is not a possible alternative to build native code for pi?
02:21:47disrupteknim offers the elegance of lisp and the speed of c/c++. the ffi is unmatched. the metaprogramming is unmatched. the syntax is unmatched. the portability is pretty hard to beat. the ergonomics are unmatched by any compiled language that i'm aware of, aside from a functional language with a repl, let's say.
02:22:19disruptekyou can build the nim compiler on an pi.
02:22:24FromDiscord<Technisha Circuit> Inim is a solution for the repl issuue
02:22:28FromDiscord<Technisha Circuit> (edit) 'issuue' => 'issue'
02:22:32disruptekyes, you can build any nim software you want to run there.
02:22:57FromDiscord<Technisha Circuit> If i can build and use Nim on my phone, then anyone should be able to use Nim on a rpi-
02:23:01FromDiscord<Elegant Beef> Nim reads and write easily whist not comprimising on functionality
02:23:26disruptektargetting rpi eliminates a lot of other languages that just aren't good choice for embedded.
02:23:27FromDiscord<Technisha Circuit> Also @Synth doesn't like Rust anymore
02:23:41FromDiscord<Technisha Circuit> Explain why please Synth :P
02:23:58FromDiscord<Rika> I am depressed, my keyboard is broken
02:24:07FromDiscord<Rika> Will I have to become technicae
02:24:12FromDiscord<Elegant Beef> Well be happy you can spell derpessed still
02:24:16FromDiscord<Technisha Circuit> Bruh, I've been depressed for god knows how many years
02:24:17FromDiscord<Elegant Beef> depressed* 😄
02:24:17disrupteksounds like your keyboard is depressed.
02:24:19FromDiscord<Synth> > If you dont like rust use nim↵@Elegant Beef Same, I switched to Nim from Rust
02:24:19FromDiscord<Rika> I don't wanna be another technicae
02:24:31FromDiscord<Technisha Circuit> Use your laptop then @Rika
02:24:35FromDiscord<Rika> @Elegant Beef have you heard of a phone
02:24:40FromDiscord<Elegant Beef> No
02:24:43FromDiscord<Rika> @Technisha Circuit good point
02:24:44FromDiscord<Elegant Beef> Mine's a paperweight
02:24:54FromDiscord<Technisha Circuit> People who started programming on PC won't be able to use a mobile to code
02:24:59FromDiscord<Rika> I'll prolly just laze around until I buy a replacement tho
02:25:01FromDiscord<Elegant Beef> The last practical thing i did on my phone was use it for a email notifiier
02:25:03FromDiscord<Technisha Circuit> It'll be too hard of a switch for them
02:25:03FromDiscord<Elegant Beef> Or a clock
02:25:07FromDiscord<Rika> @Technisha Circuit I've done it
02:25:18FromDiscord<Technisha Circuit> Not for large programs-
02:25:19FromDiscord<Rika> It's kinda irritating but it's doable
02:25:26FromDiscord<Rika> Ssh exists lol
02:25:38FromDiscord<Elegant Beef> Well synth i didnt ever use rust, i just looked at rust and went no
02:25:40FromDiscord<Technisha Circuit> That's not from your phone then, is it?
02:25:48FromDiscord<Rika> I'll have to type on a phone
02:25:51FromDiscord<Technisha Circuit> That's using ssh
02:25:55FromDiscord<Rika> Use the phones screen
02:26:01FromDiscord<Rika> Not use a moise
02:26:02FromDiscord<Technisha Circuit> You should compile everything on your phone too
02:26:07FromDiscord<Technisha Circuit> Then you'll know my pain
02:26:14FromDiscord<Elegant Beef> Im a game dev mostly that uses Unity, so recently i wanted to learn something outside of that and looked at the options and found Nim and was intrigued cause of it's cleanliness
02:26:16FromDiscord<Rika> Okay
02:26:23FromDiscord<Rika> I don't want to know your pain
02:26:27FromDiscord<Technisha Circuit> Hahaha
02:26:41FromDiscord<Rika> I don't really care to know about your pain either so
02:26:48FromDiscord<Technisha Circuit> Also, what's a good uncommon prefix for a discord bot?
02:26:58FromDiscord<Elegant Beef> Make the nim compiler run on a Commedore 64 then see how it works for embedded
02:27:01FromDiscord<Rika> (initial of bot)~
02:27:13FromDiscord<Elegant Beef> FuckingUselessBot
02:27:14FromDiscord<Technisha Circuit> > I don't really care to know about your pain either so↵sEe ThIs WhY i Am DePrEsSeD-
02:27:14FromDiscord<Elegant Beef> Best name
02:27:27giacodisruptek: thanks for the feedback. I've been spending the last 4 days tasting go and rust, and well, now I'm here. Something something tells me that I won't be happy following rust or go
02:27:29FromDiscord<Rika> Oof lmao
02:27:44FromDiscord<Technisha Circuit> The bot is called `Nimmie`
02:27:50disruptekgo is actually not a bad language for certain things and certain people.
02:27:58FromDiscord<Technisha Circuit> I hate Go
02:27:59FromDiscord<Rika> @giaco mind elaborating on what makes you feel those ways for both go and rust?
02:28:04FromDiscord<Technisha Circuit> Except for it's braces
02:28:17FromDiscord<Rika> @Technisha Circuit then you're not part of those certain people
02:28:18disrupteki think it's pretty well thought-out. rust, too, honestly. it's just that these languages made decisions that i simply cannot live with.
02:28:36FromDiscord<Technisha Circuit> :P
02:28:49FromDiscord<Rika> I just don't like eithers syntax lol
02:28:52FromDiscord<Elegant Beef> im picky and i see `::,->,let mut` and run
02:29:00disruptekie. go is too simple and rust is too exhausting.
02:29:09FromDiscord<Rika> Don't forget the turbo fish or whatever they fuckin call it
02:29:17FromDiscord<Elegant Beef> let mut is infurating to me
02:29:24FromDiscord<Technisha Circuit> Wdym?
02:29:27FromDiscord<Rika> Why?
02:29:37FromDiscord<Elegant Beef> Cause it's two keywords that could be one
02:30:06FromDiscord<Elegant Beef> both kotlin and nim have a single keyword to seperate mutabillity
02:30:46FromDiscord<Elegant Beef> Unless you can force mutabillity after a variable is declared i dont see why it's not just one keyword
02:30:51disruptekgiaco: do you have any other constraints, like integrations or performance requirements?
02:31:03giacoRika: I prefer go over rust, but both lacks something I used to like and use a lot in python
02:31:18disruptekeverything is a /force/ in rustland.
02:31:43FromDiscord<Technisha Circuit> :p
02:31:50disrupteka lot of python folks come to nim. it's similar on the surface, but very different.
02:32:01FromDiscord<speckledlemon> I'm a Python programmer by day/night and Rust + Nim by night. What do you use Python for?
02:32:07FromDiscord<Technisha Circuit> I came from Python and I'm loving Nim-
02:32:14disruptekwith python, you're used to having to be careful when coding to achieve performance.
02:32:21FromDiscord<Elegant Beef> Nim has that thing that python doesnt, *static typing*
02:32:35FromDiscord<Technisha Circuit> I also like static typing at times
02:32:41FromDiscord<Elegant Beef> "at times"
02:32:41FromDiscord<Technisha Circuit> And not so much at others
02:32:47FromDiscord<Technisha Circuit> :P
02:33:11FromDiscord<Elegant Beef> If the time percentage isnt greater or equal to 100% you gave the wrong answer
02:33:23FromDiscord<Technisha Circuit> I just can't remember what type a proc is :P
02:33:24FromDiscord<Technisha Circuit> Wait
02:33:27giacodisruptek: well I'd like need to convert all my python scripts made for rpi into native binaries. Rewriting them in rust or go would be much more than mere rewriting the programs from scratch. Nim feels like more ... lazy?
02:33:30FromDiscord<Elegant Beef> a proc is a proc
02:33:38FromDiscord<Technisha Circuit> Is there a way to check types in Nim?
02:33:39PrestigeHm Anyone know how to turn a ptr cuchar into a string?
02:33:45FromDiscord<Elegant Beef> `type(var)`
02:33:52FromDiscord<Technisha Circuit> Oh, thanks :P
02:33:58FromDiscord<Rika> Isn't it typeof
02:34:04FromDiscord<Elegant Beef> probably
02:34:07FromDiscord<Technisha Circuit> O
02:34:18FromDiscord<Elegant Beef> Both work for int atleast
02:34:38disruptekgiaco: it'll be great for that. just remember that OOP is a fad and you'll be fine.
02:34:55FromDiscord<Technisha Circuit> Could i do `var name:type(proc() = echo "Yeet")`?
02:34:59FromDiscord<Technisha Circuit> Probably not xD
02:35:06giacodisruptek: /me googling "fad"
02:35:40FromDiscord<Elegant Beef> Why would you tech
02:35:44disrupteki think go binaries are pretty huge; not sure it'd make my shortlist for this. too verbose for my taste, though i think it has a place in industry.
02:35:52FromDiscord<Elegant Beef> You're declaring a body and the type right there
02:36:06FromDiscord<Elegant Beef> It's a void parameterless proc and it's body is an echo
02:36:07FromDiscord<Technisha Circuit> Just curious :P
02:36:31FromDiscord<Elegant Beef> the type is literally a `proc()`
02:36:40FromDiscord<Technisha Circuit> :p
02:37:03FromDiscord<Technisha Circuit> But then i also have to do `{.gcsafe, locks:0.}` too :P
02:37:07FromDiscord<Technisha Circuit> As the pragmas
02:37:16FromDiscord<Elegant Beef> no
02:37:47PrestigeBeef you have any idea? I'm trying to get a string property from x11. Getting back a PPcuchar but am not sure how to get the string at the address
02:37:55FromDiscord<Elegant Beef> Nope that's low level shit
02:37:58FromDiscord<Elegant Beef> Im a numpty there
02:38:16FromDiscord<Elegant Beef> Tech idk what you mean↵https://play.nim-lang.org/#ix=2oRW
02:38:19giacodisruptek: the min size I've achieved with go with stripping, linkage optimization and compression is ~400kb
02:38:20disruptekwhat is PPcuchar?
02:38:22FromDiscord<Rika> Doesn't ppcuchar mean pointer to pointer of an unsigned char
02:38:29giacodisruptek: on x86
02:38:31Prestigeptr ptr cuchar disruptek
02:38:43FromDiscord<Elegant Beef> It's a penisy cuchar
02:38:44disrupteksome[][]
02:39:11PrestigeYeah that will get me to a cuchar
02:39:36giacodisruptek: following this guide https://blog.filippo.io/shrink-your-go-binaries-with-this-one-weird-trick/
02:40:00PrestigeBut I'm not sure how to take a cuchar and a length and get the string from it
02:40:05disruptekwhat does a 400k go program do?
02:40:20FromDiscord<Elegant Beef> I bet it goes
02:40:48disruptekPrestige: add .cstring
02:41:37Prestigewell hot damn thanks
02:41:45disrupteksure.
02:42:00disruptekgiaco: i think we've managed a 3k hello world. something like that.
02:42:41disruptekthere are a couple kernels in nim, a poc linux kernel module... you don't need to bundle extra stuff.
02:43:13disruptekoh, i would consider zig for your application, too. it'll be competitive, but not as nice. you can compile nim with a zig compiler, if that's your wont.
02:45:05giacozip? let me google. I feel today one of those days where you discover something important
02:45:19disruptekno, zig
02:45:29disruptekziglang.org
02:46:05giacosorry, I mistyped. I got it right in google
02:48:11FromDiscord<Elegant Beef> How dare you mistype it you've doomed us all
02:48:58disrupteki'm not afraid of "competition" from zig.
02:49:04giacodisruptek: what's the point of compiling nim with zig compiler? (I think you're talking about this https://forum.nim-lang.org/t/5939)
02:49:35disrupteki think the thread does a good job of explaining some reasons, right?
02:50:02FromDiscord<Elegant Beef> Lol it's 2020 and disruptek expects people to read
02:50:22disrupteki'm shouting right now.
02:51:43FromDiscord<Elegant Beef> Good
02:52:01disrupteki'm having a problem with my colon.
02:52:19disruptekcolontmp__1, i mean.
02:52:22FromDiscord<Elegant Beef> Is it semi
02:52:40disruptekno, that was ages ago.
02:53:00giacodisruptek: I mean, that topic doesn't expose the point. Is it about cross compilation?
02:53:04disrupteki gave up perl after too much syntactic sugar gave me cancer of the semicolon.
02:53:20disruptekgiaco: it is. and having a smaller, simpler toolchain.
02:57:49giacodisruptek: I need some time to find out where I've been all this time without meeting nim or zig. Seems promising. Thanks for the info
02:57:57disrupteksure thing.
02:58:18disrupteki think zig would make more sense if you were coming from c and just wanted something a little more ergonomic.
02:58:29disruptekbut coming from python, you will love nim.
02:58:35disruptekhave fun.
02:58:40Prestigehm I'm getting an illegal storage access error when trying to read a cstring.. wonder why
02:59:02FromDiscord<Elegant Beef> Coming from most higher level languages i'd argue you'd like nim, unless you think significant whitespace is an issue
02:59:03disruptekcstrings have nil terminators.
02:59:22PrestigeI am just trying to convert it to a normal string with $
02:59:39Prestigeactually it's in an option and calling myOption.get throws the error, without trying to convert it
03:00:06disrupteksounds like the option is empty (none).
03:00:25giacodisruptek: well actually I've spent 5 years on C/C++, 4 in C#, 5 on python. That's why I don't want to go back :D
03:00:25PrestigeI am checking with isSome beforehand
03:00:45FromDiscord<Elegant Beef> well get could be an issue if it doesnt have a nil at the end and it's a cstring
03:00:46FromDiscord<Elegant Beef> but idk
03:00:53disruptek^
03:00:59Prestigehmm that is interesting
03:01:09disruptekuse your length value to terminate it.
03:01:14disruptekwith EXTREME prejudice.
03:01:16FromDiscord<Elegant Beef> Well i assume without a nil it never escapes so goes through all the memory
03:01:29disrupteklaughing all the way!
03:01:44disrupteki found c# pretty nice to use, actually.
03:01:46PrestigeThat's a good point. Although since it's a string handled by xlib I'd think it would be nil terminated, no?
03:01:57disrupteki'm just not about clr, at least until they port it to jvm.
03:01:58FromDiscord<Rika> Might not be
03:02:18FromDiscord<Elegant Beef> port it to jvm 😄
03:02:28FromDiscord<Elegant Beef> That's a joke right
03:02:29disruptekyes, it's not happening any time soon.
03:02:39giacodisruptek: C# is my favourite language, but is not good for scripting, or doing science, or REPL
03:02:40disruptekgiaco: graalvm
03:02:53disrupteksomething to talk to google about.
03:03:02FromDiscord<Elegant Beef> not good for scripting, meanwhile it's used as the scripting language in Unity
03:03:10FromDiscord<Elegant Beef> Or is that programming language 😄
03:03:22disrupteki liked it. i just hacked it, though.
03:03:37disruptekbut, nim's superior.
03:05:48giacoElegant Beef, I've been a video game unity developer for those 4 years with C# (from unity 0.something to ~2.8). I stand my point, C# is not a scripting language, you have to learn all the things that the unity engine is doing under the hood to understand all the effort to make it look like it is
03:05:54*Tlongir joined #nim
03:07:45FromDiscord<Elegant Beef> I dont know what you mean but ok
03:08:17giacodisruptek: graalvm. Appropriate name, in my case
03:10:46disruptekPrestige: if you know the length, set the terminator before $'ing it.
03:11:17disruptekthere are some cstring utils in a cstrutils module iirc.
03:11:24PrestigeTrying that now but still getting the error - wouldn't it just be myCString[len - 1] = '\0'?
03:11:41disruptekseems likely, yes.
03:12:03Prestigehm. I feel like I must be doing something incorrectly
03:12:05disruptekmake sure the length is >0.
03:12:50disrupteksomeone write down this number: 13956241
03:12:55disrupteknever mind.
03:14:12FromDiscord<Elegant Beef> Too late i have your SIN
03:17:08PrestigeSo the size it is returning back is equal to the number of chars.. so can I not access myCString[len] to assign it to a null byte?
03:18:12disruptekperhaps not.
03:19:07disruptekthe c in cstring is "compatible". it works the same as c/js/objc. so if they don't terminate it, you have to just snarf up the bits you want.
03:19:45disrupteki've been protesting about it all week; maybe you've seen me at the rally in DC?
03:20:14disruptekTERMINATE STRINGS
03:20:23FromDiscord<Elegant Beef> Are you inside the babygate or outside it?
03:20:35disruptekthe babygate. lol
03:21:11disrupteki can't travel as freely as i used to.
03:21:31disrupteki only fly at night, now.
03:21:46FromDiscord<Elegant Beef> It's fine atleast you dont have to worry about social distancing since people tend to run when they see you
03:21:56disruptekno one sees me.
03:21:58disruptekNO ONE.
03:23:02FromDiscord<Elegant Beef> I guess you're right cause they tend to just flee
03:23:24disruptekyou get one whiff and you're moving to the other side of the street, i promise.
03:24:47PrestigeOkay so even trying to access myCString[0] gives me an illegal access error
03:25:16disruptekyourCString is nil, boss.
03:25:33disruptekit's okay, i have a bug in my colon.
03:25:39disruptekmy colontmp__1 i mean.
03:25:43PrestigeLol
03:25:59PrestigeI wonder why this isn't working just for cstrings... same code is working for other data types
03:26:28disruptektake away a []
03:27:40giacodisruptek: graalvm is serious black magic
03:27:56disruptekit's pretty badass.
03:28:00giacodidn't know about Truffle
03:28:38disrupteki think the python impl was one of the first.
03:31:26Prestigeoh I think I know what's going on. So I'm having to pass in a ptr cstring into this C function - do I have to allocate space for the cstring first somehow?
03:31:38disrupteksure.
03:32:54disruptekalloc0(100) will give you one hundred squeaky clean bytes.
03:33:08disruptekyou're going to love the way you look.
03:33:11disrupteki guarantee it.
03:35:16FromDiscord<Rika> Ngl I enjoy how disruptek speaks
03:35:31disruptekhow about this comment i just added to the compiler:
03:35:35disruptek# this is kinda important; only an idiot would omit it on his first try
03:36:09FromDiscord<Rika> So did you omit it on your first try
03:36:19disruptekno comment.
03:36:32giacodisruptek: reading that python compatibily in graalvm is at early stage is quite a show stopper :-/ but hell what a marvel
03:37:27*bung joined #nim
03:37:36PrestigeAre there docs on cstrings somewhere? I'm not seeing a lot of info. Trying to figure out the conversion of a cstring and a ptr cuchar, I thought they were the same
03:38:30*rockcavera quit (Remote host closed the connection)
03:38:43FromDiscord<Rika> They should be no?
03:38:55FromDiscord<Rika> Are you sure the pointer isn't nil?
03:39:00FromDiscord<Rika> Try printing it with repr
03:40:26PrestigeI'm just trying to create a cstring then assign it to another var that is a ptr cuchar
03:41:24Prestigetype mismatch: got ptr cstring but expected ptr ptr cuchar
03:41:25FromDiscord<Elegant Beef> No comment disruptek, so that means you added the comment 😄
03:42:33FromDiscord<Elegant Beef> Just nuke it to space
03:46:27FromDiscord<Rika> Tried casting it?
03:46:37Prestigeah cstring is a ptr cchar not ptr cuchar
03:47:18FromDiscord<Rika> So what is an unsigned char anyway
03:47:34Prestigewdym?
03:47:47FromDiscord<Elegant Beef> a char is already unsigned
03:47:48FromDiscord<Elegant Beef> isnt it
03:47:54FromDiscord<Rika> Or does it mean unicode char
03:48:23FromDiscord<Elegant Beef> > Of the same size as char, but guaranteed to be unsigned. Contains at least the [0, 255] range.
03:48:43FromDiscord<Elegant Beef> char is a generic version of unsigned/signed char
03:48:52FromDiscord<Rika> So you can prolly cast it without a problem
03:49:19disruptekit means noone has written their name on it yet.
03:49:28Prestigeidk what's going on with that but I found another xlib function where I'm getting a proper cstring back and I don't even have to init the cstring..
03:49:29FromDiscord<Elegant Beef> Nah that's unhancocked
03:49:31disruptekecho cast[uint](someptr)
03:49:45*rockcavera joined #nim
03:51:21disruptekit's common to pass a ptr in to get scribbled on.
03:51:43FromDiscord<Elegant Beef> Also is this XGetWindowProperties, prestige?
03:51:56PrestigeYeah
03:52:15PrestigeThat is not working with cstrings with me for some reason... so I found XFetchName and that's working
03:52:42FromDiscord<Elegant Beef> Yea i couldnt figure out that proc either
03:52:51FromDiscord<Elegant Beef> Too C-ee to me
03:52:55disrupteki would take a look but i use wayland. 😜
03:53:01PrestigeI have XGetWindowProperty working for all integer types but it's doing weird shit for strings
03:53:23disruptekyou can look at how i do cstring-fu in one of my projects.
03:53:34PrestigeIt is returning the correct number of elements for the string but when I try accessing the data, I get the illegal access error
03:54:26disruptekhttps://github.com/disruptek/gittyup/blob/master/gittyup.nim#L618
03:55:55PrestigeI have this proc https://github.com/avahe-kellenberger/nimdow/blob/nimbar/src/nimdowpkg/xatoms.nim#L88 which calls https://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html
03:56:20*rockcavera quit (Remote host closed the connection)
03:56:21Prestigebut when I use cstring as the type I get that error. I mean this problem is solved by using the other function I guess so it's w/e
03:57:13FromDiscord<Elegant Beef> Let's abandon old C libs, we got a few thousand people, eveyone start reimplementing!
03:57:25Prestigenew wayland!
03:57:51disruptekfwiw you can omit the `return none(T)` because options default to empty.
03:58:32disruptekresult = propReturn[].some
03:59:30PrestigeNeat, thanks
04:00:22disruptekis it actually nil in that case?
04:00:23*rockcavera joined #nim
04:00:28PrestigeYeah, just found that out
04:00:59disrupteki really don't understand this code.
04:01:08PrestigeMy code or xlib?
04:01:34disruptekyour code.
04:02:05disrupteklemme look at the X stuff. i think you need to make propReturn a value type and /then/ pass it as a ptr with addr.
04:02:41Prestigefwiw it works with integer types
04:03:00disruptekvar propReturn = cast[cstring](alloc0 200) instead of propReturn: ptr T
04:03:37disrupteki don't think you need the later cast, but you can leave it.
04:04:08PrestigeThat may work for cstrings but if I want to keep the proc generic I'm not sure what I should do
04:04:14disruptekoh, i see.
04:04:17Prestigemaybe I'll just make another proc specifically for strings
04:04:21disruptekit's simple. make one for strings.
04:05:02FromDiscord<Elegant Beef> I mean what other values can window props have
04:05:04FromDiscord<Elegant Beef> Bools?
04:05:08disruptekpropReturn.option is probably correct, but remember to dealloc the ptr in a finally around your return.
04:05:58disrupteki would just some($propReturn) to turn it into a string. then you can free it.
04:06:01*supakeen quit (Quit: WeeChat 2.8)
04:06:23disruptekit'll work.
04:06:39*supakeen joined #nim
04:07:10disruptekit works with ints because pointers are ints, of course.
04:08:13FromDiscord<Elegant Beef> Also because of how properties work wouldnt it make more sense to return an object variant in there, since i do believe the props store the data type you get
04:09:32disruptekit might make more sense to change the behavior for strings using a `when` clause versus a separate proc. this is a pretty verbose, or at least /tall/, animal. i guess you are developing on an iphone5?
04:10:58PrestigeJust how I like to style the code, don't have an ultawide monitor :P
04:11:31disruptekrelax; some are girthy, some on long and lean.
04:11:39disruptekit's what you do with it that counts.
04:12:15giacodisruptek: thanks for the all the info, I need some sleep to wrap my head around all these news
04:12:26disruptekaight, peace out and welcome to the community.
04:12:42FromDiscord<Elegant Beef> i have a 1080p 24" monitor and i think you use 1/12th of it
04:13:07disrupteknonsense, i'm 8" on a good day.
04:13:31Prestigemaybe: https://0x0.st/iVgZ.png
04:13:43Prestigeeasier reading for me tho
04:15:38FromDiscord<Elegant Beef> If by easier you mean more annyoing, sure!
04:15:55FromDiscord<Elegant Beef> Use columns of 1, and there you go
04:15:57FromDiscord<Elegant Beef> 😄
04:16:26Prestigewhere in blazes is the xft documentation
04:22:05*rockcavera quit (Remote host closed the connection)
04:42:33*B4s1l3 joined #nim
04:42:55*B4s1l3 is now known as opDispatch
04:57:27*nsf joined #nim
05:00:15*aeverr quit (Quit: Konversation terminated!)
05:00:16*aeverr_ joined #nim
05:07:36*aenesidemus_ joined #nim
05:10:54*aenesidemus quit (Ping timeout: 256 seconds)
05:10:57*dddddd quit (Ping timeout: 260 seconds)
05:15:41*solitudesf joined #nim
05:23:43*aeverr_ quit (Ping timeout: 246 seconds)
05:41:57*endragor quit (Remote host closed the connection)
05:49:14*aeverr_ joined #nim
05:54:02*aeverr_ quit (Ping timeout: 256 seconds)
05:56:44*endragor joined #nim
06:04:41*waleee-cl quit (Quit: Connection closed for inactivity)
06:11:26*aeverr_ joined #nim
06:15:23*aeverr joined #nim
06:16:34*aeverr_ quit (Ping timeout: 246 seconds)
06:16:34*kenran joined #nim
06:17:51*aeverr quit (Read error: Connection reset by peer)
06:18:07*aeverr joined #nim
06:23:23*PMunch joined #nim
06:25:51*aenesidemus_ quit (Ping timeout: 260 seconds)
06:35:26bungfor js backend , can I use import syntax ?
06:36:39FromDiscord<Rika> Yeah
06:39:27*Vladar joined #nim
06:41:24bungI just tried , it resolve to nim file
06:42:06bungI meat to import from node_modules
06:45:19PrestigeIs there no standard for loop in nim e.g. for i = 0, i < 10, i.inc ?
06:46:16FromDiscord<Zed> what do you mean?
06:46:45Prestigelike a for loop that has an initialization, condition, and action if the condition completes (after the body)
06:46:56PrestigeLike in c, java, etc
06:47:11FromDiscord<Zed> example?
06:47:17FromDiscord<Zed> in c/java
06:47:31Prestigelike this: https://www.tutorialspoint.com/cprogramming/c_for_loop.htm
06:48:11FromDiscord<Zed> that's basically a normal for loop
06:48:18FromDiscord<Zed> for i in 0..<10
06:49:24PrestigeI'd like to be able to use it like those other languages, where you can declare a variable (or multiple variables) inside the for loop, have any condition and any action
06:49:35PMunchNo, there is no for loop with those three specific phases (unless of course you write your own iterator)
06:49:52FromDiscord<Zed> declare the variables outside the for loop and then assign them inside the loop
06:50:11PrestigeMight just make my own iterator, thought that'd be part of the language
06:50:57FromDiscord<Zed> sent a code paste, see http://ix.io/2oSe
06:51:14FromDiscord<Zed> (edit) 'http://ix.io/2oSe' => 'http://ix.io/2oSf'
06:51:23FromDiscord<Rika> @bung jsffi has a requires
06:51:59PMunchhttps://play.nim-lang.org/#ix=2oSg
06:52:05PMunchPrestige ^
06:52:10FromDiscord<Rika> @Prestige no since those kinds of for loops are glorified while loops
06:52:28PMunch(That looks horrible and please don't do that please though)
06:52:55*oculuxe quit (Ping timeout: 260 seconds)
06:52:56FromDiscord<Rika> You dislike it so hard you say please twice
06:53:10FromDiscord<Zed> it's bad
06:53:18PMunchI considered adding a "please thanks" at the end as well
06:53:33FromDiscord<Zed> what does yield do?
06:53:33PrestigeYeah I'd probably do something different
06:54:09*oculux joined #nim
06:54:20PMunch"returns" a value from an iterator
06:54:45PrestigeI meant something like this @Zed https://pastebin.com/eSnKW6Wc (java example)
06:55:04PMunchYou can call an iterator many times and it will "yield" things to you and then continue from the same place the next time you call it
06:55:27PMunchBut yeah, since Nim for loops automatically unpacks tuples the most royale way of doing it would be to write an iterator
06:56:46FromGitter<bung87> @Rika I know that, but it requires whole module
06:57:58PMunchPrestige: https://play.nim-lang.org/#ix=2oSh
06:58:17PMunchNot as compact, but way more readable
06:58:33PMunchAnd you need to name your iterator..
06:58:44Prestigeyeah I might tackle that later.. trying to convert some c code to nim atm
06:58:49Prestigealways fun :p
06:59:32PMunchThe other option is of course to write a template that does this, but Nim isn't always as easy to one-line
07:00:34FromDiscord<Zed> ```↵iterator myIter(): tuple[i, j: int] =↵ var i = 0;var j = 1;while i * j < 24: yield (i, j);inc i;j += 2↵```
07:00:41FromDiscord<Zed> This is as compact as i could get it
07:01:56FromDiscord<Zed> you could remove alot of the spaces if you wanted to
07:06:07PrestigeI feel like I shouldn't have to be manually decoding utf8..
07:06:22Prestigetrying to get emojis to render on my status bar PMunch
07:06:24*tane_ joined #nim
07:17:08PMunchOh, nice
07:17:14PMunchBut yeah, you probably shouldn't
07:17:59PrestigeYeah.. I really need to find docs for xft
07:23:11*letto quit (Quit: Konversation terminated!)
07:25:23*letto joined #nim
07:33:34*Vladar quit (Read error: Connection reset by peer)
07:35:16*Vladar joined #nim
07:37:43PrestigePMunch: Is there a way to change an object's internal string with a proc? e.g. https://play.nim-lang.org/#ix=2oSl
07:38:06Prestigeor does it just need to be exposed
07:38:33PMunchYes, pass it as a var: https://play.nim-lang.org/#ix=2oSm
07:38:38PMunch(And make it a variable)
07:39:26Prestigeah, thanks
07:41:41*fredrikhr joined #nim
07:42:30*fredrikhr quit (Read error: Connection reset by peer)
07:47:20PrestigeComing along though: https://0x0.st/iVEc.png just need to figure out emojis, and then render window titles in the center of the bar.. almost there.
07:47:28*fredrikhr joined #nim
07:48:42PMunchLooking good!
07:51:10PrestigeThanks :)
07:54:06*tdc joined #nim
08:03:58*Trustable joined #nim
08:32:33voltistPrestige: Is that your Nim WM?
08:32:35ZevvPMunch: I do like the fibers idea, but I'm not sure about the whole infrastructure in the queue handling. I must admit I don't understand all the details yet, though
08:33:37PMunchZevv, hmm, what part of it is it that you don't like?
08:34:12PMunchAnd that's the good thing about these fibers, you can easily implement your own queue :)
08:35:53Zevvwell, that I need a central queue at all - but like I said, I need to spend more time on it before having Opinions I guess
08:47:12PMunchOh you don't need it
08:47:53PMunchIts use is explicit, and it just gives you one way of using fibers
08:48:40PMunchYou can also have more than one, and call one queue from a fiber scheduled in another
08:51:02*neceve_ joined #nim
09:02:57Zevvah right
09:10:33PMunchThe only thing about the queue is that it asserts a certain pattern
09:11:47PMunchBasically a fiber can be either running or finished, returned something or not, and specified a next fiber or not. This means that there are 8 states a fiber can be in, and the queue assigns these states special semantics
09:13:28*oddp joined #nim
09:14:10*lritter joined #nim
09:43:38FromDiscord<Shucks> I want a `initDefaultValuesForNotFoundKeys` option for `json.to` 😄
09:44:50*Tlongir quit (Quit: Leaving)
09:47:23FromDiscord<Shucks> like: https://play.nim-lang.org/#ix=2oT7
09:53:19*chemist69 quit (Ping timeout: 260 seconds)
09:53:53*sagax joined #nim
09:54:06*chemist69 joined #nim
09:56:12FromDiscord<Shucks> nvm, found a pull request. this works: https://play.nim-lang.org/#ix=2oT7
09:56:34FromDiscord<Shucks> sorry, this one https://play.nim-lang.org/#ix=2oTa
09:56:41FromDiscord<Shucks> (edit) 'works: https://play.nim-lang.org/#ix=2oT7' => 'works'
09:58:42*NimBot joined #nim
10:17:37Prestigevoltist: yep that's nimdow
10:17:44PrestigeWorking on creating my own status bar
10:19:38FromDiscord<Zed> Prestige, How do you find nim with vim? I couldn't get the hang of not having intelli-sense
10:20:13PrestigeI'm using coc-nvim with nimlsp, it's pretty good
10:20:30PMunchI use old vim with nimlsp, works pretty well as well
10:20:32PrestigeAlso using nim.nvim for Syntax highlighting
10:20:52PMunchBut then again I've been using Nim in Vim with nothing but syntax highlighting for years..
10:21:15FromDiscord<Zed> what's you coc language server file look like? i couldn't get it working properly
10:23:03*pietroppeter joined #nim
10:36:18FromDiscord<Zed> huh, just testing it out now it's working, weird
10:47:54FromDiscord<Recruit_main707> can i know the name of the file where my program is? (at compile time)?
10:48:25FromDiscord<Zed> ?
10:48:46FromDiscord<Zed> what file your program is currently in?
10:49:53FromDiscord<Recruit_main707> for example, `nim c example.nim`↵and i want to generate a file with a macro, `example.txt`
10:51:18FromDiscord<Zed> i dont think i understand what your trying to do
10:51:36PMunchHe wants to know the name of his module
10:51:45FromDiscord<Recruit_main707> ^
10:52:13FromDiscord<Zed> well i think i might disappear out the backdoor
10:52:51PMunchhttps://stackoverflow.com/questions/29398377/unit-testing-in-nim-is-it-possible-to-get-the-name-of-a-source-file-at-compile
10:53:15FromDiscord<Recruit_main707> thanks
11:08:03*kradnoel joined #nim
11:08:26*kradnoel quit (Read error: Connection reset by peer)
11:10:19*kradnoel joined #nim
11:10:56*kradnoel quit (Remote host closed the connection)
11:11:58Yardanicowe also have https://nim-lang.org/docs/system.html#currentSourcePath.t FYI
11:12:03Yardanico(for full path to the source file)
11:12:17Yardanicoalthough it uses instantiation info inside anyway lol
11:12:21Yardanicoit's 1-line template
11:26:02*thomasross quit (Ping timeout: 256 seconds)
11:35:25*krux02 joined #nim
11:39:00*krux02` joined #nim
11:39:07*dddddd joined #nim
11:48:22*kenran quit (Ping timeout: 246 seconds)
11:48:46*Tlongir joined #nim
11:56:54FromDiscord<Recruit_main707> is there a unified way to get the name of a proc/func inside a macro?, because the asterix adds aPostFix node that changes the name position
11:57:26Yardanicowhat about https://nim-lang.org/docs/macros.html#name%2CNimNode
11:57:41FromDiscord<Recruit_main707> smh, yeah, just found it, sorry
11:57:42Yardanicoit handles postfix stuff automatically
12:00:10*liblq-dev joined #nim
12:06:01*supakeen quit (Quit: WeeChat 2.8)
12:06:38*supakeen joined #nim
12:22:25*Tlongir quit (Ping timeout: 264 seconds)
12:31:06*sacredfrog quit (Quit: ZNC 1.8.0 - https://znc.in)
12:32:26*noonien quit (Ping timeout: 258 seconds)
12:32:34*ormiret quit (Read error: Connection reset by peer)
12:32:40*rockcavera joined #nim
12:32:55*ormiret joined #nim
12:33:06*sacredfrog joined #nim
12:33:06*npgm quit (Read error: Connection reset by peer)
12:33:11*LyndsySimon quit (Read error: Connection reset by peer)
12:33:29*npgm joined #nim
12:33:31*LyndsySimon joined #nim
12:33:32*noonien joined #nim
12:46:50FromDiscord<Technisha Circuit> Dimscord is OP imo
12:47:05FromDiscord<Technisha Circuit> Better then any Python lib for sure
12:47:52FromGitter<alehander92> is this "original poster"
12:47:56FromGitter<alehander92> or another meaning of OP
12:48:16FromGitter<Vindaar> overpowered?
12:48:19Yardanicoyes
12:48:21*marnix joined #nim
12:50:00FromGitter<alehander92> so is this a good thing
12:50:13FromGitter<alehander92> or like overengineered
12:50:26Yardanicooverpowered != overengineered
12:50:29YardanicoOP has a positive accent
12:50:40PMunchpls nerf
12:50:41FromGitter<Vindaar> well it's a term from video games. Usually refers to characters / skills / weapons being too strong
12:51:14FromGitter<alehander92> so like rails is OP in ruby web frameworks
12:51:21FromGitter<alehander92> or bulgaria in yoghurt
12:51:40FromGitter<alehander92> kidding about the last thing, probably there is some giant yoghurt economic battle there
12:52:10livcdBulgaria is cool!
12:53:54FromGitter<alehander92> yeah, there is yoghurt in korea as well, right, no wonder livcd feels like that!
12:55:02livcdThere is denmark yogurt in Korea
12:55:11livcdhas nothing to do with denmark
12:55:35FromGitter<alehander92> hm, they had something called svar i think?
12:56:33livcdThat's the literal branding name. Denmark yogurt/milk lol
12:56:36FromGitter<alehander92> skyr? smary? totally dont get it
12:56:37FromGitter<alehander92> oh yeah
12:56:49FromGitter<alehander92> i think bulgaria has that as well as a brand
12:57:02FromGitter<alehander92> like, people sell this, not sure if bulgaria owns it at all
12:57:32FromGitter<alehander92> maybe it was licensed by meiji
12:57:48*theelous3 joined #nim
12:58:12FromDiscord<Technisha Circuit> :p
12:58:36FromGitter<alehander92> yeah they do it since the 70s it seems: its a source of national pride for us, dont ask
12:58:49*Vladar quit (Quit: Leaving)
12:59:32*Trustable quit (Remote host closed the connection)
13:01:22FromDiscord<Technisha Circuit> I'm asking-
13:06:27FromDiscord<Technisha Circuit> When i use `#? Code` at the start of the file, does it apply to the whole file?
13:08:33PMunchalehander92, we have something called Skyr here in Norway
13:08:58PMunch@Technisha Circuit, what do you mean?
13:10:47FromGitter<anon767> Hey guys, short question, could some give me some advise on how to write Idiomatic Nim code? ⏎ Im currently porting the learnopengl breakout game from cpp to Nim. ⏎ Id really appreciate some constructiv criticism: https://github.com/anon767/nimgl-breakout
13:10:56alehander92_disruptek
13:11:06alehander92_can i ask you stuff later
13:11:39alehander92_PMunch yeah maybe that? tasted well
13:11:51PMunchYeah it's pretty good
13:12:13PMunch@anon767, NEP-1 is the current style guide
13:12:15alehander92_i like fruit milk overall
13:12:33PMunchhttps://nim-lang.org/docs/nep1.html
13:12:38PMunch~nep1
13:12:38disbotno footnotes for `nep1`. 🙁
13:12:44PMunch~nep1 is https://nim-lang.org/docs/nep1.html
13:12:45disbotnep1: 11https://nim-lang.org/docs/nep1.html
13:12:49PMunchñep
13:12:52PMunch~nep1
13:12:53disbotnep1: 11https://nim-lang.org/docs/nep1.html -- PMunch
13:12:56FromGitter<anon767> is there a linter support?
13:13:52PMunchYou have --styleCheck
13:14:12PMunchThere's also nimfmt
13:15:17FromGitter<bung87> nimfmt? included in distrubtion? have not seen
13:15:38PMunchNo, it's an external tool by federico3
13:15:47PMunch`nimble install nimfmt` I assume
13:15:50FromGitter<bung87> found deprecated nimfix yesterday
13:15:52zedeuswhat about nimpretty?
13:16:02alehander92_hmm whats the difference
13:16:06alehander92_with nimpretty
13:16:47zedeusnimfmt uses nimpretty as a library I guess
13:16:57FromGitter<anon767> cool I try nimfmt
13:18:16bungnimpretty remove space between string args, eg "a" "b" will format as "a""b"
13:19:42alehander92_guys how to delete `-f` in bash
13:20:02PMunchWhat do you mean?
13:21:00alehander92_ok so `rm ./-f`
13:21:20alehander92_it appeared surprisingly hard to remove a file starting with dash
13:23:25PMunchOh, you wanted to remove a file called "-f" :P
13:38:31*kenran joined #nim
13:40:14federico3zedeus: nimfmt uses nimpretty indeed
13:40:37*pbb_ joined #nim
13:40:49*pbb quit (Ping timeout: 272 seconds)
13:42:50disruptekyou can often rm -- -f
13:45:02ZevvYeah, that used to be one of my hobbies. Dropping files called `-rf` everywhere
13:45:43disruptek`-rf /` you mean
13:46:03Zevvcruelty comes in different forms, I guess
13:46:10disrupteklol
13:48:48Yardanicodisruptek: /*
13:49:04Yardanicorm -rf / has a safe-guard nowadays
13:49:13Yardanicoso either rm -rf /* or rm -rf --no-preserve-root /
13:49:14zedeus/**/*
13:49:46disrupteka safe-guard?
13:50:41Yardanicoyes
13:50:44Yardanico--no-preserve-root
13:50:48Zevvlet me try that!
13:51:04*Zevv left #nim ("Connection dropped")
13:51:11YardanicoLMAO
13:51:28zedeussomebody forgot to tell him --perserver-root isn't default on all distros
13:51:36zedeus--preserve-root*
13:51:36disruptekthe ol' --no-preserve-root trick. right up there with alt-f4 aim assist.
13:51:38*Zevv joined #nim
13:51:43ZevvBoy am I funny or what
13:51:53zedeusvery
13:52:03*PMunch *shudders*
13:52:04disrupteki had a minion's software once rm -rf / on me.
13:53:26PMunchReminds me of a time in the #manjaro channel when someone came asking for help and it overlapped with another discussion so I ended up replying with something like "Then you just have to rm -rf /*" or something like that and he went "ok" and disconnected..
13:53:27ZevvI am so old, I deleted my VAX kernel once because I didn't know what this huge file in the root was
13:53:45PMunchHaha, nice one Zevv
13:54:02disrupteki don't think it'd dc you.
13:54:33Zevvright. Your session might perfectly survive
13:54:58Zevvbut we've all been there right? "ls: command not found"
13:55:09disruptekyeah.
13:55:21FromGitter<Vindaar> yup
13:55:21PMunchDon't think I've managed to rm -rf my system, but I did once manage to copy an unpacked ARM system into / instead of the ./ of the removeable media I was meaning to put it on
13:55:36YardanicoI ran rm -rf once
13:55:38ZevvI spent an intoxicated night reassembling my partition tables by hand after copying an 1.44 MB floppy image to /dev/hda
13:55:39Yardanicofrom some script :P
13:55:42Zevvthose were the days
13:55:50PMunchThat was fun, programs slowly dying, windows changing their themes before closing
13:56:00disruptekoh, right. partition tables from memory.
13:56:03PMunchManaged to log back on afterwards, but the system was pretty unusable
13:56:05disruptekhow many times...
13:56:31PMunchHaha, poor partition tables
13:57:21disrupteki'm not switching to bcachefs because i cannot be bothered to compile a missing dependency from source.
13:57:29disruptekhow the times have changed.
13:57:40YardanicoI switched to ZFS a few days ago btw
13:57:54disruptekyeah?
13:57:56Yardanicoyes
13:58:15disrupteki deeply regret using apfs on my osx drive.
14:05:10disruptekwhat's really crazy is that i actually built a custom version of my kernel for bcachefs and simply because i am missing a single dependency, i cannot be bothered to compile the tools.
14:08:01*PMunch quit (Quit: leaving)
14:15:26*xet7 quit (Quit: Leaving)
14:16:15FromDiscord<Technisha Circuit> > @Technisha Circuit Circuit, what do you mean?↵For example when i do `#? replace(sub=">", by=" ")`, does that apply to the whole file!
14:16:19FromDiscord<Technisha Circuit> (edit) 'file!' => 'file?'
14:16:57FromGitter<alehander92> disruptek can we just like save the memory state of the compiler and start it
14:16:58FromGitter<alehander92> https://unix.stackexchange.com/questions/43854/save-entire-process-for-continuation-after-reboot
14:17:24FromGitter<alehander92> https://blog.thecybershadow.net/2018/11/18/d-compilation-is-too-slow-and-i-am-forking-the-compiler/
14:17:28FromGitter<alehander92> i think some d guy did it
14:17:54*waleee-cl joined #nim
14:20:11FromGitter<alehander92> like ok this is more complicated than i imagined: but maybe just loading the forked process
14:21:27FromDiscord<bojun> Question, what is the recommend plugging for Nim in neovim?
14:22:06Yardanicohttps://github.com/alaviss/nim.nvim
14:22:09FromGitter<alehander92> sorry for going too much into your stuff, just wondered if its viable (but yeah one needs to change state after loading "freezed process" )
14:22:20FromGitter<alehander92> so its not as simple as i thought so probably normal IC is better
14:25:44FromDiscord<bojun> will that conflict if I if use nimlsp by coc?
14:25:57YardanicoI don't know honestly
14:26:11Yardaniconvim uses nimsuggest directly
14:26:39Yardanicoso it'll probably conflict :)
14:26:49Yardanicobut with nim.nvim you should have autocompletion too
14:26:50FromDiscord<Recruit_main707> can a macro force a compile setting? ie: `--app:lib`?
14:26:58Yardanicono, a .nims file can
14:27:06FromDiscord<Recruit_main707> ok
14:27:13Yardanicoconfigs are evaluated before the code
14:28:43FromDiscord<Recruit_main707> can i check wether app:lib is being used though?
14:29:18Yardanicoyes
14:29:34Yardanicotry https://nim-lang.org/docs/compilesettings.html
14:30:07Yardanicoah wait
14:30:09Yardanicothere's a simpler way
14:30:11Yardanicohttps://nim-lang.org/docs/system.html#appType
14:31:44FromDiscord<Recruit_main707> thats really nice
14:31:46FromDiscord<Recruit_main707> thank you
14:31:58Yardanicoi didnt know that exists either, just searched for it :)
14:35:55FromDiscord<bojun> Thanks Yardanico
14:46:47FromDiscord<Recruit_main707> will fmAppend create a new file if it does not exist?↵and if it doesnt, how can that be done?
14:47:17YardanicofmReadWriteExisting ?
14:47:28Yardanicoah right not that one
14:49:51*rokups joined #nim
14:52:12FromDiscord<Recruit_main707> also, if thats even possible at runtime, i doubt it is at compile time
14:52:28Yardanicowell you can always go the simple way
14:52:33Yardanicocheck if the file exists or not
14:52:39Yardanicoand based on that either fmWrite or fmAppend
14:55:23FromDiscord<Recruit_main707> ill try that
14:57:16disruptekpass a set or `or` them together.
14:57:48Yardanicothat's not how it works with os open
14:57:56disruptekalehander92: sounds kinda silly, right?
14:57:57Yardanicoand it's not possible at OS level anyway
14:58:43disruptekof course it is.
14:58:56disruptekman -s 2 open
14:59:00disruptekor w/e
14:59:07Yardanicowell at least not in nim then
14:59:11disruptekalehander92: you might enjoy learning about criu
15:04:24FromGitter<kaushalmodi> Recruit_main707, Yardanico: Yep, I use `when appType=="lib":` all the time
15:10:25*aenesidemus joined #nim
15:12:51*Vladar joined #nim
15:13:26FromGitter<bung87> Ive seen issue with file io not raise error
15:13:32*xet7 joined #nim
15:28:28*aenesidemus quit (Read error: Connection reset by peer)
15:30:05disruptekAraq: {.emit: "throw e;".} cheater
15:38:23FromGitter<alehander92> disruptek yeah i read a bit today
15:38:24FromGitter<alehander92> after this
15:38:39disruptekit's neat, right?
15:38:54FromGitter<alehander92> seems nice, and maybe adaptable
15:39:23FromGitter<alehander92> if instead of "precompiled module prelude/lib"
15:39:40FromGitter<alehander92> you have "prestarted compiler in criu"
15:40:01disruptekit's nuts for that application, though.
15:40:13FromGitter<alehander92> and a viable way to just add to the new module paths and continue from there
15:41:10FromGitter<alehander92> i guess so, i mean serializing / importing seems better but still
15:41:14FromGitter<alehander92> a funny way to look at it
15:41:41FromGitter<alehander92> i guess criu reloading might not be fast anyway
15:42:25*endragor quit (Remote host closed the connection)
15:56:01FromDiscord<codic> apparently httpclient now requires a client but didn't before. So I took nim-speech and changed all the methods to `client.` methods (after creating a var client = newHttpClient()): https://hastebin.com/nanazofaya.pl. but line 47 `var response : Response = client.post(url, headers, body)` refuses to work, it keeps saying that `client` is a string. any idea why?
15:56:22Yardanicobecause of shadowing
15:56:29Yardanicoyou're shadowing a global variable with a proc argument
15:56:39Yardanicoeither rename the global "client" variable or the "client" argument
15:58:24FromDiscord<codic> Oh i'm stupid
15:59:09FromDiscord<codic> It still errors out on this line `var response : Response = hclient.post(url, headers, body)`
15:59:21FromDiscord<codic> `/home/solus/coding/tts/speech.nim(47, 38) Error: type mismatch: got <HttpClient, string, string, string>`
15:59:40Yardanicoyes because headers must be set to a client instance
15:59:48Yardanicoclient.headers
16:01:11*Trustable joined #nim
16:05:23FromDiscord<codic> so instead of headers i used hclient.headers and now got `type mismatch: got <HttpClient, string, HttpHeaders, string>`
16:05:32Yardanico?
16:05:35Yardanicohclient.headers = headers
16:05:39Yardanicothat's how you should do it
16:05:48Yardanicoand headers must be a HttpHeaders
16:05:50Yardaniconot a string
16:06:09Yardanicohttps://nim-lang.org/docs/httpclient.html check examples here
16:06:40FromDiscord<codic> no here i have `post(hclient, url, hclient.headers, body)` so hclient.headers are HttpHeaders
16:06:51FromDiscord<codic> body and url are strings toh
16:06:53FromDiscord<codic> (edit) removed 'toh'
16:07:01Yardanicono
16:07:02Yardanicothat's wrong
16:07:11YardanicoI said you need to set headers in the different place
16:07:24*kitech1- joined #nim
16:07:26Yardanicocheck the httpclient top examples
16:07:34Yardanicohclient.headers = newHttpHeaders(...) and then hclient.post(url, body)
16:07:38*kitech1 quit (Ping timeout: 260 seconds)
16:07:43FromDiscord<codic> Ohhhh
16:08:19*a_chou joined #nim
16:09:18FromDiscord<codic> Okay now it compiles
16:09:22FromDiscord<codic> Running get https://hatebin.com/efcejjnoft
16:09:28FromDiscord<codic> get == it gets
16:09:42Yardanicoare you sure the URL still works?
16:10:07FromDiscord<codic> > 400: Your client has issued a malformed or illegal request. Missing parameter: key That’s all we know.
16:10:18Yardanicowell that's not a problem with nim :)
16:10:21FromDiscord<codic> so I have to add the key header :p
16:10:38FromDiscord<codic> please work
16:10:48FromDiscord<codic> yeah, same error...
16:11:16FromDiscord<codic> is there another lib i can use for speech-to-text?
16:13:17Yardanicoidk :)
16:18:11*marnix quit (Ping timeout: 256 seconds)
16:26:08bung400 error response from service side
16:26:29FromDiscord<Zachary Carter> does anyone know of a way to declare a sequence whose members have specific alignment requirements?
16:26:50FromDiscord<Zachary Carter> or should I just use pointers?
16:27:25disruptekthere is an alignment pragma but i've never used it. you could just pad the member types, i guess.
16:27:37FromDiscord<Zachary Carter> alignment pragma doesn't work on types though
16:27:42FromDiscord<Zachary Carter> only variables and object fields
16:27:43disruptekwhat would a pointer do for you?
16:27:55disrupteki think i don't understand the question.
16:29:00FromDiscord<Zachary Carter> actually nothing - you're right, I was thinking I could declare the type in C and importc it but it doesn't matter then whether I"m using a seq or a linked list
16:29:44FromDiscord<Zachary Carter> https://github.com/nim-lang/Nim/issues/14509 - I guess it's another issue to chalk up to the first `wall` in this issue
16:29:47disbotsemcheck fails while trying to instantiate an unused module for no reason ; snippet at 12https://play.nim-lang.org/#ix=2oUO
16:30:17FromDiscord<Zachary Carter> or make the `align` pragma work on types
16:30:27FromDiscord<Zachary Carter> but I'll just pad like you suggested for now
16:30:39bungcan I dump c struct ? am not sure am reading the right version source file
16:31:33disruptekdump it? it's just memory.
16:31:47disruptektypes are just semantics; they don't exist at runtime.
16:31:57disruptekso i dunno what an alignment pragma would mean there.
16:32:02bungwhen I echo the struct `error: variable has incomplete type 'struct pri'` so am wrapping wrong ?
16:32:49FromDiscord<Zachary Carter> I'm not asking for it to do anything at runtime - I want to achieve parity with the C alignment attribute
16:33:00FromDiscord<Zachary Carter> which I realize is compiler implementation specific
16:33:21FromDiscord<Zachary Carter> so I guess codgenDecl is the way to go - if it were to work with type definitions
16:34:00disruptekafaik, it does.
16:34:12disruptekbung: can you show some code?
16:34:13FromDiscord<Zachary Carter> it doesn't
16:34:21*a_chou quit (Quit: a_chou)
16:34:26FromDiscord<Zachary Carter> unless something just recently changed
16:36:36bungyeah , you working on mac?
16:36:40disrupteknope.
16:36:59disruptek`working` is too strong a word for what i do.
16:37:21bunghttps://github.com/juancarlospaco/psutil-nim/blob/4acb5c72ae01759e69b057d0e9fa20634d03ff0b/src/psutil/arch/osx/socket.nim#L150
16:37:44bungmonths ago work, I wonder if I can fix
16:38:23disruptekthere's an incompleteStruct pragma. i never bothered to learn how it works, but i've used it and you can, too.
16:39:05FromDiscord<Zachary Carter> lol
16:40:46bungincompleteStruct to pri or socket_info ?
16:40:52bungor both
16:41:00FromDiscord<Zachary Carter> pri is the incomplete struct no?
16:41:07FromDiscord<Zachary Carter> look at the C code you're wrapping
16:42:03bungpri is incomplete ,but there's hack_to_avoid_copying_more_structs , I dont rember who wrote this.
16:43:07FromDiscord<Zachary Carter> well then slap that bad boy on pri
16:43:11FromDiscord<Zachary Carter> because that's the incomplete struct 🙂
16:43:17FromDiscord<Zachary Carter> and yes that is some hack
16:45:44bungwhen I echo socket_info it will throw error, but runs well, except not getting `family` from the struct
16:47:52*Kaivo quit (Quit: switching to vpn)
16:48:26*Kaivo joined #nim
16:49:34FromDiscord<Zachary Carter> all `incompleteStruct` does is - https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-incompletestruct-pragma
16:50:04FromDiscord<Zachary Carter> I'm not sure where it's failing on echo... but I'm not surprised it's failing since the Nim type is not fully defined
16:50:13FromDiscord<Zachary Carter> maybe just don't echo it?
16:53:43bungsounds reasonable, but the problem is I cant get soi_family it always 0
16:56:30bunghow you usually wrap the c lib, I search it through search engine and read from opensource.apple.com
16:56:38FromDiscord<Zachary Carter> I don't know enough about psutil or those bindings to really help much more
16:56:50FromDiscord<Zachary Carter> I use nimterop or roll them by hand
16:57:04FromDiscord<Zachary Carter> sometimes with the aid of c2nim
16:58:00FromGitter<brentp> hi, for objects, system.`$` works automatically. for ref objects, no. how can i deref a ref object to get a repr?
16:58:04bunghmm, maybe I just need find out where the c header file located.
16:58:36FromDiscord<Zachary Carter> brentp: `refObj[]`
16:59:10FromDiscord<Zachary Carter> bung: I don't even see a `struct pri` declared in `socket.h` on osx
16:59:37*rokups quit (Quit: Connection closed for inactivity)
16:59:52FromGitter<brentp> @zacharycarter cheers.
17:00:02FromDiscord<Zachary Carter> https://opensource.apple.com/source/xnu/xnu-201/bsd/sys/socket.h.auto.html
17:00:21FromDiscord<Recruit_main707> how can i check if something exists in an enum?↵something like this for context:↵`if afunction.params[0].kind notin NimTypeKind:`
17:00:46FromDiscord<Zachary Carter> an enum is not a set
17:00:54disruptekdon't be rude.
17:01:20FromDiscord<Zachary Carter> if `kind` is defined with a type of the `enum`
17:01:29FromDiscord<Zachary Carter> this check should happen at compile time and isn't necessary at runtime
17:01:53FromDiscord<Zachary Carter> or you can create a `set` with enum values and then perform the not in check
17:02:40bungoh, right, it's coming from proc_info.h
17:03:02Zevveh Zachary, where did you end up now? Back to the USA?
17:03:36FromDiscord<Zachary Carter> yeah - I'm in Austin TX
17:03:48FromDiscord<Zachary Carter> but once I'm married I want to go back to Europe
17:04:07FromDiscord<Zachary Carter> if any country will take people from the US at that point
17:04:14FromDiscord<Zachary Carter> might be stuck here forever
17:06:19Zevvmarry a european girl :)
17:06:24Zevvthat's what I did.
17:06:28Yardanicolol
17:06:32ZevvOh no, I didn.t. She's swiss
17:06:42FromDiscord<Zachary Carter> I came back for an American girl
17:06:46FromDiscord<Zachary Carter> I guess I screwed up
17:06:48FromDiscord<Zachary Carter> 😛
17:06:50ZevvYeah people from the US. I'll think about it, but no promises
17:06:51FromDiscord<Zachary Carter> don't tell her I said that please
17:07:25FromDiscord<Rika> Calling her right now.
17:07:27FromDiscord<djazz> 🍿
17:07:35ZevvYou do know that the percepted IQ of all US citizes has dropped quite a bit over the last few years, right?
17:07:42Zevvand I *know* you can't help it. But still.
17:08:03ZevvYou were cool and all when you were still on this side. But now, I don't know anymore :)
17:08:08FromDiscord<Zachary Carter> hahaha
17:08:18FromDiscord<Zachary Carter> I've always maintained that we're a country full of simpletons
17:08:45FromDiscord<Zachary Carter> but I mean - I can't blame the rest of the world if they don't want anything to do with us anymore
17:09:52FromDiscord<Zachary Carter> one of my old bosses in Finland, who is back in the UK now is starting a studio - hoping he will offer me a job once they're funded
17:09:58FromDiscord<Zachary Carter> if they ever get funded
17:10:04FromDiscord<djazz> _is quite happy with his bordic country. Mostly. Not perfect_
17:10:11FromDiscord<djazz> Nordic*
17:10:24FromDiscord<Zachary Carter> yeah I miss Finland
17:10:29FromDiscord<Rika> Bordic
17:10:37FromDiscord<Zachary Carter> I was confused for a moment a well
17:11:32FromDiscord<djazz> Have you read the book ”nordic theory of love”, its by a fin who found love in the US and moved there
17:12:00FromDiscord<Zachary Carter> I have not
17:12:21FromDiscord<Zachary Carter> but I'm an American who found love in the US, moved to Finland and then back to the US
17:12:34FromDiscord<djazz> Alright
17:12:43FromDiscord<Zachary Carter> maybe I should write a book
17:12:58FromDiscord<Zachary Carter> could call it the American theory of love and why you should just stay in Finland
17:13:10Zevv"Nim for dummies", and sell it in the USA
17:13:11FromDiscord<djazz> XD
17:13:16Zevvhaha I am so funny
17:13:26Zevvsecond time today, even
17:13:27FromDiscord<Zachary Carter> oh yeah - we need a dummies Nim book for sure
17:13:30YardanicoZevv: 👏👏👏👏👏
17:13:48Yardanico:rofl: :lmao: :100: :fire:
17:13:55FromDiscord<Zachary Carter> is there a `how to write a dummies book for dummies`?
17:13:57Yardanico:laughing:
17:17:52FromDiscord<Recruit_main707> > create a `set` with enum values↵how is that?
17:20:58Zevvrecruit_main707: https://play.nim-lang.org/#ix=2oUW
17:21:00Zevvdoes that help
17:21:02Yardanico{a, b, c}
17:22:26ZevvYardanico: I get the "Yar" and the "dan" part, is the "ico" merely eastetic or is that your middle nmae?
17:22:33FromDiscord<Recruit_main707> ok
17:22:35FromDiscord<Recruit_main707> thx
17:23:30YardanicoZevv: that's esoteric, but I think you're the first one who guessed where "Yar" and "Dan" come from :D
17:23:36YardanicoI just wanted a good suffix for the nickname
17:23:44Zevvyour suffix is my first name
17:24:03Yardanicoit's pretty dumb to use my real name/surname though, IDK why i made it that way
17:24:19Yardanicoalthough it's not easy to guess
17:27:22*waleee-cl quit (Quit: Connection closed for inactivity)
17:27:40Zevvwell, it is, apparently :)
17:30:01FromGitter<antonkatz> Hi all! Just discovered NIm and instantly got the urge to start writing in it.
17:30:15Zevvwell, what's stopping you! :)
17:30:38FromGitter<antonkatz> The one thing that's keeping me from jumping in is reading that I can't use most of the standard library when compiling to javascript :(
17:30:42FromGitter<antonkatz> Why is that?
17:31:28FromDiscord<Zachary Carter> a lot of the stdlib doesn't really apply to JS
17:31:52FromDiscord<Zachary Carter> unless you're targeting NodeJS
17:32:03Zevvbut that's kind of silly.
17:32:14FromDiscord<djazz> There is a DOM module right?
17:32:17FromDiscord<Zachary Carter> yes
17:32:22ZevvThe problem is that when you target browser JS, you're limited anyway. You can't just do socket I/O or read and write files
17:32:47FromDiscord<Zachary Carter> yeah - I guess a good question is antonkatz: what modules of the stdlib do you want to use that the JS backend doesn't support?
17:33:06Zevvtechnically, some things also don't port to JS because there's no things like pointers and raw memory
17:33:45FromDiscord<djazz> I am mainly a JS guy but I have yet to try nim to JS heh
17:33:52FromDiscord<Zachary Carter> JS is the worst
17:34:19FromDiscord<djazz> >_>
17:34:23FromDiscord<Zachary Carter> I wish I could unlearn everything I knew about the web
17:34:27Zevvyeah, I see Nim-JS as a kind of happy coincedence. Bobrossian compilation.
17:34:29FromGitter<antonkatz> I haven't explored much yet, for example the Collections and Parsers modules would be nice, otherwise I have to import them from javascript itself
17:34:53Zevvwe have a pretty cool parser generator that runs on js
17:34:55FromGitter<antonkatz> As far as targeting node -- in the context of serverless (AWS Lambda Google Functions) it's useful
17:35:16FromDiscord<Zachary Carter> you can write Nim lambdas that compile to C
17:35:33FromDiscord<djazz> Yeah
17:35:54FromDiscord<djazz> On the server, if you can, just skip node if you are using nim anyways
17:36:06FromGitter<antonkatz> Kinda, since neither Google nor Amazon provide proper C support (amazon does but it's a pain)
17:36:11FromDiscord<djazz> Server, serverless whatever xD
17:36:47FromGitter<antonkatz> I love serverless because then I can be just a programmer, and not a sys-admin
17:36:50FromDiscord<Zachary Carter> hmmm?
17:36:59FromDiscord<Zachary Carter> I just wrote a lambda with the serverless framework on AWS
17:37:06FromDiscord<Zachary Carter> in Nim targeting the C backend
17:37:16FromGitter<antonkatz> tell me more
17:37:34FromDiscord<Zachary Carter> well I probably still have the project on my hd let me see
17:37:51FromGitter<antonkatz> this? https://www.serverless.com/
17:37:57FromDiscord<Zachary Carter> yes
17:38:08FromGitter<antonkatz> free version or paid?
17:38:43FromDiscord<Zachary Carter> free
17:38:50FromDiscord<Zachary Carter> https://github.com/lambci/awslambda.nim - there's this
17:39:35FromDiscord<Zachary Carter> and https://github.com/epiphone/serverless-nim
17:39:55ZevvWhy does 2020 lambda feel so similar to 1993 CGI
17:40:00Zevvhave we gone full circle?
17:40:00FromDiscord<Zachary Carter> I think the only painful part was getting SSL support working - so I had to write a Dockerifle that installed nim on some AWS iamge
17:40:14FromDiscord<Zachary Carter> pretty much
17:40:30ZevvI had disruptek try to explain me what lambda is, because I just couldn't understand
17:40:33Zevvhe failed I guess
17:40:53disruptekyay, someone is using atoz.
17:40:57FromDiscord<djazz> only serverless stuff i've done is some with Netlify Functions
17:41:04FromDiscord<Zachary Carter> lambda is CGI but it scales
17:41:09FromDiscord<Zachary Carter> and it still has all the pain points
17:41:11Zevvscaling is so overrated
17:41:29disruptekapi gateway is cgi but it scales.
17:41:35disrupteklambda can be attached to anything.
17:41:46disruptekstreams, database triggers, pub/sub, anything.
17:41:53FromDiscord<Zachary Carter> okay fair enough
17:42:02*nsf quit (Quit: WeeChat 2.8)
17:42:54FromDiscord<djazz> also been using PHP for ages, and that is basically serverless too
17:43:00FromDiscord<djazz> hehe
17:43:06disrupteki am thinking of doing some auctionhero work again. it'd be a good place to demo all the aws stuff i do.
17:43:40FromGitter<antonkatz> @zacharycarter do I have to use both the repositories to get it going on lamda? Or just the first?
17:44:02FromDiscord<Zachary Carter> well the second one I linked is geared towards the serverless framework
17:44:13FromDiscord<Zachary Carter> if you want to just use lambda without serverless - don't use the second
17:44:22*kenran_ joined #nim
17:44:51FromDiscord<djazz> serverless' name cause confusion heh
17:46:48FromGitter<antonkatz> @zacharycarter setting up without `serverless` framework will be a pain, so will use both
17:47:05FromGitter<antonkatz> Thank you a ton. I'm now willing to give it a go
17:47:11*kenran quit (Ping timeout: 260 seconds)
17:47:12FromDiscord<djazz> good luck!
17:47:24FromGitter<antonkatz> Thank you!
17:47:43FromGitter<antonkatz> PS. What IDE do you use?
17:48:18FromDiscord<djazz> I use VSCode
17:48:55FromDiscord<Zachary Carter> I don't use an IDE - I use kakoune
17:50:19FromDiscord<Zachary Carter> but yeah - I think most folks use VSCode however some use emacs, a lot use vim
17:50:43FromDiscord<Zachary Carter> I think there's a couple of folks that use IntelliJ but I'm not really sure what types of features are supported
17:51:37FromGitter<antonkatz> oohh, I like my IntelliJ, just used to it like an old fart.
17:58:29*chemist69 quit (Ping timeout: 256 seconds)
17:59:26*chemist69 joined #nim
17:59:32FromDiscord<Zachary Carter> yeah - it's just very resource heavy
18:00:06FromDiscord<Zachary Carter> and you won't benefit from the refactoring tools that Java has - and I have no idea whether things like nimsuggest / nimpretty etc work with it
18:00:27FromDiscord<Zachary Carter> but I'm sure other folks who use IntelliJ would be willing to help you out with that kind of stuff - I think there's a nim plugin for it, can probably find it on github
18:00:32FromDiscord<Zachary Carter> !repo intellij
18:00:34disbothttps://github.com/judasn/IntelliJ-IDEA-Tutorial -- 9IntelliJ-IDEA-Tutorial: 11IntelliJ IDEA 简体中文专题教程 15 15856⭐ 6617🍴 7& 29 more...
18:00:44FromDiscord<Zachary Carter> !repo nim intellij
18:00:46disbothttps://github.com/jhspetersson/idea-nim -- 9idea-nim: 11Nim language support for Intellij IDEA by JetBrains 15 22⭐ 1🍴 7& 5 more...
18:00:50FromDiscord<Zachary Carter> there you go
18:06:43FromGitter<antonkatz> Sweet.
18:06:56FromGitter<antonkatz> You guys are super helpful. Awesome onboarding experience.
18:15:38bungfinally I done it, it was my mistake passing wrong argument, I did it after midnight.
18:20:35*bung quit (Quit: Lost terminal)
18:23:08FromDiscord<Recruit_main707> that intellij plugin only has syntax highlight iirc
18:24:34FromDiscord<Recruit_main707> there was a newer one, but it seems to havent been updated already
18:26:11FromGitter<antonkatz> PS. How is debugging experience with Nim?
18:27:43*Tyresc joined #nim
18:31:41FromDiscord<Generic> with arbitrary code execution at compile time you can't really get around using the Nim compiler for intellisense
18:33:22*team\andinus quit (Quit: ERC (IRC client for Emacs 26.3))
18:34:16*team\andinus joined #nim
18:34:33FromDiscord<Zachary Carter> I'd get comfortable with gdb / lldb for debugging Nim
18:34:50FromDiscord<djazz> going to work some on my web framework and stream it <https://www.twitch.tv/daniel_hede/>
18:35:03FromDiscord<Zachary Carter> what web framework is this?
18:35:05FromDiscord<djazz> source https://github.com/daniel-j/koan
18:35:30FromDiscord<djazz> will work more on the router stuff
18:35:54FromDiscord<djazz> im porting the koa node module to nim
18:41:17FromDiscord<Technisha Circuit> How would i catch all exceptions then turn it to a string? I've done `except Exception as e: discard await bot.api.sendMessage(m.channel_id, $e)` but that didn't work
18:41:26FromDiscord<Technisha Circuit> Yes this is for my bot
18:41:37FromDiscord<Technisha Circuit> So i need to turn the exception into a string
18:45:03*aeverr quit (Ping timeout: 260 seconds)
18:47:25Yardanicoe.msg
18:58:30*aeverr joined #nim
19:00:35*marnix joined #nim
19:08:32*waleee-cl joined #nim
19:17:02disruptekthe throbbing is fierce today.
19:17:18Yardanico so I forgot, is there a way to understand where an "Exception" comes from when I do {.raises: [].} ?
19:17:53disruptekprobably not.
19:18:11Yardanicoah {.effects.}, but it's not easy to insert it recursively :P
19:21:19Yardanicoohh I understood why
19:21:32Yardanicoit's because my lib allows for user-defined functions
19:21:44Yardanicoand since the compiler doesn't know what they'll throw it assumes "Exception"
19:21:59disruptekyeah, this is only half the problem, though.
19:43:27*aeverr quit (Ping timeout: 265 seconds)
19:48:58*aeverr joined #nim
19:49:27FromDiscord<djazz> tables have a toTable proc, but how do you convert it to a seq of tuples?
19:49:43disruptektoSeq pairs
19:50:03FromDiscord<Technisha Circuit> > e.msg↵Thanks
19:50:35FromDiscord<djazz> I have a `Table[string, string]` that I want to become something that `openArray[(string, string)]` accepts
19:50:50FromDiscord<djazz> pairs is an iterator
19:50:58disruptek/toSeq/ pairs
19:51:08FromDiscord<djazz> combined? ah
19:51:49FromDiscord<Rika> Still wish templates and macros worked with ufcs
19:56:59FromDiscord<Technisha Circuit> How do I catch all errors?
19:57:07FromDiscord<Technisha Circuit> (edit) 'errors?' => 'errors in Nim?'
19:59:24FromDiscord<Rika> Bare except
19:59:24Yardanico"try: stuff"
19:59:27Yardanicoexcept: stuff
19:59:53FromDiscord<Rika> Are defects still catchable by default
19:59:58Yardanicoby default yes
20:00:01Yardanicofor backwards compat
20:00:15Yardanico--panics:on to make them unrecoverable
20:00:16FromGitter<alehander92> interesting what is the flag
20:00:18FromGitter<alehander92> ah ok
20:00:19FromDiscord<Technisha Circuit> I need to be able to get the error message though
20:00:21FromGitter<alehander92> does it quit
20:00:25FromDiscord<Rika> Oh nice kinda wanna make that default
20:00:25Yardanico@Technisha getCurrentExceptionMsg()
20:00:31FromGitter<alehander92> wow fast
20:00:37FromDiscord<Technisha Circuit> Inside an except block?
20:00:39Yardanicoyes
20:00:42Yardanicohttps://nim-lang.org/docs/system.html#getCurrentExceptionMsg
20:00:45FromDiscord<Technisha Circuit> Thanks!
20:00:50FromGitter<alehander92> or except CatchableError as e:
20:00:58Yardanicoyeah
20:00:58disruptekdoes your phone have a web-browser?
20:01:01FromGitter<alehander92> i *think* the second one might be pure-r
20:01:03FromDiscord<Rika> Won't catch defects tho
20:01:09Yardanico@Rika and that's good
20:01:14FromDiscord<Rika> Yeah
20:01:14Yardanicocatching "Exception" is bad
20:01:27FromDiscord<Rika> It's just an fyi
20:03:07FromGitter<timotheecour> Can anyone please review https://github.com/nim-lang/Nim/pull/14634 ? it should fix a very flaky test
20:03:10disbotfix #13166 tioselectors flaky test on freebsd+OSX ; snippet at 12https://play.nim-lang.org/#ix=2oVL
20:05:43*marnix quit (Ping timeout: 246 seconds)
20:16:51*tane_ quit (Quit: Leaving)
20:34:01*NimBot joined #nim
20:44:37*tdc quit (Ping timeout: 264 seconds)
20:54:35*aeverr quit (Remote host closed the connection)
20:56:28*neceve_ quit (Ping timeout: 246 seconds)
21:08:24*oprypin quit (Quit: Bye)
21:08:32*oprypin joined #nim
21:08:51*oprypin quit (Client Quit)
21:08:58*oprypin joined #nim
21:13:06*solitudesf quit (Ping timeout: 256 seconds)
21:31:35*Vladar quit (Quit: Leaving)
21:31:50*Jesin quit (Quit: Leaving)
21:32:23disruptek!last clyybber
21:32:24disbotclyybber spoke in 12#nim-offtopic 4 days ago
21:33:07disruptek!last varriount
21:33:08disbotVarriount spoke in 12#nim 25 hours ago 12https://irclogs.nim-lang.org/10-06-2020.html#19:48:18
21:34:32*Jesin joined #nim
21:35:54*Trustable quit (Remote host closed the connection)
21:35:54*kenran_ quit (Ping timeout: 240 seconds)
21:43:54*aeverr joined #nim
21:51:56*PMunch joined #nim
21:52:36*liblq-dev quit (Read error: Connection reset by peer)
22:02:24FromDiscord<Recruit_main707> Yardanico, you probably know, but if anyone else does, id apreciate it.↵If im not mistaken, this would deallocate the object because it falls out of scope right? (that exportpy pragma is of my own)↵If it does deallocate it, how can i make sure it actually does? https://media.discordapp.net/attachments/371759389889003532/720759868050505748/unknown.png
22:02:53Yardanicowell as I said for 100% certainty use GC_ref and GC_unref
22:02:59YardanicoGC_ref when passing the object to python
22:03:12YardanicoGC_unref when destroying it on nim side (with a call from python)
22:03:20FromDiscord<Recruit_main707> but its not a `ref object`
22:03:24Yardanicoso?
22:03:26YardanicoGC_ref is not about ref objects
22:03:31Yardanicoit's about refcounts
22:03:42Yardanico@Recruit_main707 ah wait
22:03:45Yardanicowdym not a ref object
22:03:50Yardanicoif it's not a ref object then it's a value type
22:04:03Yardanicobut you pass it by pointer don't you
22:04:09FromDiscord<Recruit_main707> ye
22:04:23Yardanicowhy not use make it "ref object" instead and just do stuff like I did in https://github.com/Yardanico/nim-snippets/blob/master/clib/lib.nim? :P
22:04:38Yardanicoidk, your approach might work too, but I don't know a lot about that stuff
22:04:51Yardanicovalue types don't say in the GC at all
22:04:55Yardanicoand "ptr" is not managed by the GC
22:05:20Yardanicowell I mean that value types don't need to be refcounted and stuff as far as I understand, since they are copied most of the time
22:05:55FromDiscord<Recruit_main707> im just really weird, i guess i could use ref, but id like to know if that would actually work if someone else knows
22:06:07Yardanicowell check https://github.com/Yardanico/nim-snippets/blob/master/clib/lib.nim? as I said
22:06:07FromDiscord<Recruit_main707> thanks Yardanico
22:06:08Yardanicoit works just fine
22:06:17YardaniconewEvaluator returns a ref object
22:06:27Yardanicothen I just GC_ref it and cast to pointer
22:06:27*lritter quit (Quit: Leaving)
22:06:36FromDiscord<Recruit_main707> yeah, i have had a look at it several times, its a really good example
22:07:00Yardanicoif you make your bot a ref type it should work in your case too I guess
22:07:15disruptekso many questions...
22:07:44disruptekuse a value type, write a destructor, pass it as `addr bot`.
22:07:47disruptekdone.
22:08:07Yardanicodisruptek: but how will Nim know that it's not destroyed yet?
22:08:15YardanicoI mean how will NIm know that it can't destroy it*
22:08:27disruptekwhy would you want to destroy it?
22:08:44Yardanicothe destructor will be called in the end of the proc scope
22:08:50Yardanicounless you use GC_ref
22:08:57disruptekare you /trying/ to destroy it?
22:09:09Yardanicodisruptek: ???
22:09:12disruptekput your bot somewhere where it won't get destroyed?
22:10:37FromDiscord<Recruit_main707> i think you are both confusing eachother more and more :P
22:10:49Yardanicoi'm going to sleep now anyway :P
22:11:01FromDiscord<Recruit_main707> me too, gn
22:56:23PMunchHmm, god damn it.. I've been trying to fix a bug in my keepass script for ages now
22:56:43PMunchTurns out it works when compiled with devel, but not with release..
22:57:34FromDiscord<Rika> so what was broken
22:58:22PMunchNo idea
22:58:39PMunchBut it's this code: https://github.com/PMunch/libkeepass/blob/master/src/libkeepass.nim
22:59:19PMunchIt managed to decrypt the XML fine, but all the passwords are wrong, so I guess the error lies in here: https://github.com/PMunch/libkeepass/blob/master/src/libkeepass.nim#L252-L262
23:01:37PMunchHmm, I guess it might be this: https://github.com/PMunch/libkeepass/blob/master/src/libkeepass/salsa.nim
23:07:05*konradmb joined #nim
23:09:07*zedeus quit (Ping timeout: 246 seconds)
23:10:11*PMunch quit (Quit: leaving)
23:14:47*konradmb quit (Read error: Connection reset by peer)
23:15:18*konradmb joined #nim
23:20:14*krux02` quit (Remote host closed the connection)
23:20:14*krux02 quit (Remote host closed the connection)
23:22:26*zedeus joined #nim
23:26:57*konradmb quit (Read error: Connection reset by peer)
23:27:56*konradmb joined #nim
23:31:02*konradmb quit (Read error: Connection reset by peer)
23:31:41*konradmb joined #nim
23:33:54*konradmb quit (Read error: Connection reset by peer)
23:34:56*konradmb joined #nim
23:35:08*konradmb quit (Read error: Connection reset by peer)
23:46:37*konradmb joined #nim
23:54:18*konradmb quit (Quit: Leaving)
23:54:40*konradmb joined #nim
23:57:55*konradmb quit (Client Quit)
23:58:38*konradmb joined #nim