00:16:12 | FromDiscord | <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:57 | giaco | I 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:03 | FromDiscord | <Elegant Beef> Nice |
00:42:04 | FromDiscord | <Elegant Beef> Nim is nice |
00:42:16 | FromDiscord | <Elegant Beef> That's what the nice in nim is short for... wait it's not there but it should be 😄 |
00:42:56 | FromDiscord | <Shucks> Coming from go/python. Nim feels awesome. |
00:43:07 | FromDiscord | <Shucks> even without goroutines ;D |
00:43:36 | FromDiscord | <Elegant Beef> the name goroutines hurt |
00:44:28 | FromDiscord | <Elegant Beef> in go do they name for loops gopher |
00:45:04 | giaco | well, gophers are go enthusiasts |
00:45:09 | giaco | and also rodents |
00:45:54 | giaco | how can nim transpile to different languages without being built on llvm? |
00:57:15 | zedeus | nim doesn't "transpile", it compiles |
00:57:23 | zedeus | how 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:44 | giaco | zedeus: wait a second, isn't nim outputting C, C++ or JavaScript code (to be further processed in first 2 cases)? |
01:11:46 | zedeus | indeed, but the code it outputs is considered lower level than the Nim code (and handwritten code in those languages) |
01:12:57 | FromDiscord | <Rika> i like to think that transpiling isnt a word |
01:13:15 | FromDiscord | <Rika> if you think about it, there isnt really enough difference between compilation and transpilation |
01:13:15 | zedeus | transpiling 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:27 | zedeus | besides, Nim does have an LLVM backend, and calling Nim -> LLVM IR transpiling is obviously wrong |
01:26:51 | disruptek | is it? |
01:26:55 | FromDiscord | <Technisha Circuit> What's the best way to store data simply in Nim? Json? |
01:27:08 | disruptek | it seems reasonable to draw a distinction between code that runs on hardware and code that doesn't. |
01:30:01 | FromDiscord | <Rika> so would you call "Nim -> LLVM IR" transpiling? |
01:30:20 | FromDiscord | <Rika> or you can change it to rust too |
01:30:32 | FromDiscord | <Avatarfighter> Would it still not be called compiling? |
01:30:51 | FromDiscord | <Rika> it -> ? |
01:30:56 | FromDiscord | <Rika> what do you refer to when you say it |
01:31:14 | FromDiscord | <Avatarfighter> Sorry I was referring to Nim -> LLVM IR |
01:31:22 | FromDiscord | <Elegant Beef> @Technisha Circuit store data in nim or with nim |
01:31:30 | FromDiscord | <Elegant Beef> Cause the best way to store data in nim is making constants |
01:31:33 | FromDiscord | <Elegant Beef> 😄 |
01:31:46 | zedeus | when compiling you go down the abstraction ladder, when transpiling you don't |
01:32:03 | FromDiscord | <Rika> @Avatarfighter with what dsrptk said it wouldnt, since LLVM IR doesnt run on hardware, no? |
01:32:23 | FromDiscord | <Avatarfighter> Well LLVM is still a machine |
01:32:31 | zedeus | assembly isn't really machine code, either |
01:32:43 | FromDiscord | <Elegant Beef> I've got a solution, dont care about the term, just do it 😄 |
01:33:34 | FromDiscord | <Avatarfighter> @Rika imo i think its compiling bc its running on the hardware provided by the vm that is LLVM |
01:33:50 | FromDiscord | <Avatarfighter> Wait is it a vm? |
01:33:53 | FromDiscord | <Elegant Beef> So then C#/Java are compiled languages? |
01:34:00 | zedeus | yes |
01:34:12 | FromDiscord | <Avatarfighter> I would think so |
01:34:23 | zedeus | Java 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:39 | FromDiscord | <Rika> i always thought java and C# were compiled |
01:34:43 | FromDiscord | <Technisha Circuit> > @Technisha Circuit store data in nim or with nim↵With Nim :P |
01:34:43 | zedeus | they are |
01:34:53 | FromDiscord | <Technisha Circuit> Java is a mix of interpretation and compilation |
01:35:00 | FromDiscord | <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:06 | FromDiscord | <Technisha Circuit> It's not fully compiled or interpreted |
01:35:11 | FromDiscord | <tyler569> it's a fuzzy line though - python compiles to bytecode too but no one calls that a compiled languages |
01:35:12 | FromDiscord | <Technisha Circuit> Well |
01:35:12 | FromDiscord | <tyler569> (edit) 'languages' => 'language' |
01:35:17 | FromDiscord | <Technisha Circuit> That's how i see it |
01:35:21 | FromDiscord | <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:23 | FromDiscord | <Technisha Circuit> That's also true |
01:35:24 | FromDiscord | <Rika> i dont use "transpiling" for that, i use "conversion" |
01:35:32 | FromDiscord | <Elegant Beef> Well tehn tech just use any file format you like |
01:35:32 | FromDiscord | <Avatarfighter> @tyler569 i believe that’s due to how its not running in a VM |
01:35:39 | FromDiscord | <Technisha Circuit> Okay then :P |
01:35:39 | FromDiscord | <tyler569> it is on a VM though |
01:35:40 | FromDiscord | <Elegant Beef> Json,toml, custom, yaml |
01:35:44 | giaco | zedeus: 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:44 | FromDiscord | <Technisha Circuit> ~~xml~~ |
01:35:47 | FromDiscord | <Rika> python is on a VM |
01:35:48 | FromDiscord | <Technisha Circuit> Custom as in? |
01:36:00 | FromDiscord | <tyler569> python is exactly as compiled as Java except that the "compilation" happens automatically when you run a script |
01:36:01 | zedeus | giaco: false, I already gave two examples |
01:36:01 | FromDiscord | <Technisha Circuit> My ownM |
01:36:02 | FromDiscord | <Elegant Beef> Your own defined file format |
01:36:05 | FromDiscord | <Technisha Circuit> (edit) 'ownM' => 'own?' |
01:36:07 | FromDiscord | <Technisha Circuit> Oh okay |
01:36:12 | zedeus | there are many programs that conver one high level language to another |
01:36:16 | zedeus | convert* |
01:36:34 | FromDiscord | <Rika> tyler: the only reason people dont call python compiled is because its VM is slow 😛 |
01:37:07 | zedeus | https://github.com/jacereda/py2nim |
01:37:18 | FromDiscord | <Avatarfighter> Actually I believe its called interpreted bc the python vm is called the interpreter |
01:37:24 | FromDiscord | <Avatarfighter> Im trying to confirm my theory rn |
01:37:28 | zedeus | https://github.com/bung87/ts2nim |
01:37:30 | FromDiscord | <Rika> ah, really? i see |
01:38:22 | FromDiscord | <Rika> i dont get this argument anymore |
01:38:29 | FromDiscord | <Avatarfighter> here is a different and way better explanation https://stackoverflow.com/questions/441824/java-virtual-machine-vs-python-interpreter-parlance |
01:38:40 | FromDiscord | <Rika> compilation is just translation of code right? so wouldnt transpiling and compiling be conceptually the same |
01:38:45 | FromDiscord | <Avatarfighter> nono |
01:38:57 | zedeus | it's a semantic difference, not a practical one |
01:38:59 | FromDiscord | <Avatarfighter> compile is moving from high level code to low level representations |
01:39:16 | FromDiscord | <Avatarfighter> transpile is the translation of one high level language to another |
01:39:19 | * | oddp quit (Ping timeout: 260 seconds) |
01:39:39 | giaco | zedeus: 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:43 | FromDiscord | <Avatarfighter> i think that makes the most sense but the language I used is debatable |
01:40:03 | FromDiscord | <Elegant Beef> I think the difference is quite moot |
01:40:17 | FromDiscord | <Avatarfighter> yeah no for sure its a bit iffy but w/e |
01:40:20 | FromDiscord | <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:23 | zedeus | giaco: 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:27 | zedeus | if that* |
01:41:33 | zedeus | python is very high level, nim is also (generally) very high level, C is not. python -> nim is transpilation, nim -> C is compilation |
01:41:51 | FromDiscord | <Elegant Beef> Well the trans part of compile means to move from one to another, and compiling means converting into machine code |
01:42:02 | FromDiscord | <Elegant Beef> of transpile* |
01:42:11 | giaco | zedeus: 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:23 | FromDiscord | <Elegant Beef> So the difference is simply whether you moved to a different language or machine code |
01:42:24 | FromDiscord | <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:45 | FromDiscord | <Technisha Circuit> I need to be able to load the code dynamically |
01:42:46 | zedeus | to 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:12 | FromDiscord | <Technisha Circuit> And I don't think NimScript is gonna help unless there's a tutorial on interacting with Nim and NimScript |
01:43:21 | FromDiscord | <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:28 | zedeus | you can use hotcode reloading |
01:43:30 | FromDiscord | <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:33 | FromDiscord | <Technisha Circuit> There us, isn't there |
01:43:35 | zedeus | https://nim-lang.org/docs/hcr.html |
01:43:45 | FromDiscord | <Technisha Circuit> Oh thanks! |
01:45:06 | FromDiscord | <Technisha Circuit> Hm |
01:45:07 | FromDiscord | <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:09 | giaco | zedeus: thanks for the answer :) |
01:45:30 | FromDiscord | <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:33 | FromDiscord | <Technisha Circuit> (edit) ':)' => ':/' |
01:45:50 | FromDiscord | <Elegant Beef> Sounds like you want a high level scripting language |
01:45:59 | FromDiscord | <Elegant Beef> 😄 |
01:46:04 | zedeus | then you gotta wait for incremental compilation |
01:46:22 | disruptek | it'll be a long wait. |
01:46:28 | zedeus | well worth it. |
01:46:30 | FromDiscord | <Elegant Beef> Based off their previous comments im uncertain which they want |
01:46:30 | FromDiscord | <Technisha Circuit> Oof |
01:49:01 | disruptek | the nim compiler could be faster, but there are very few programs known that don't compile quickly. |
01:49:05 | FromDiscord | <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:34 | disruptek | why? are you actually coding something now? |
01:50:00 | FromDiscord | <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:05 | giaco | I'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:43 | disruptek | there are a few packages that keep binaries for you so that they /feel/ like scripts but are actually based upon binary runtimes. |
01:51:07 | disruptek | what do you call /backend/ and what do you call /frontend/? |
01:51:14 | FromDiscord | <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:30 | disruptek | why would you? |
01:51:37 | FromDiscord | <Technisha Circuit> Wdym? |
01:51:49 | disruptek | why would you recompile code unless it has changed? |
01:52:27 | FromDiscord | <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:34 | zedeus | nim doesn't recompile programs that didn't change |
01:52:57 | FromDiscord | <Technisha Circuit> > For example the main.nim file might've changed ... |
01:53:03 | FromDiscord | <Technisha Circuit> :p |
01:53:10 | FromDiscord | <Rika> The top row of my keyboard broke... |
01:53:23 | disruptek | then it's wise to recompile it if you want a binary that expresses those changes. |
01:53:32 | zedeus | the actual solution to this problem is to stop compiling things on your phone. |
01:54:01 | FromDiscord | <Technisha Circuit> You know I can't do that XD |
01:54:12 | disruptek | i don't recommend using hot code reloading or plugins; they don't seem worthwhile to the task. |
01:54:13 | FromDiscord | <Technisha Circuit> Also my phone is getting laggy while compiling Nim from source |
01:54:31 | disruptek | focus on making your software work. then make it correct. then make it fast. |
01:55:03 | FromDiscord | <Technisha Circuit> It does work and idk what you mean by correct |
01:55:10 | FromDiscord | <Technisha Circuit> Minimize the bugs? |
01:55:12 | FromDiscord | <Elegant Beef> Remove the bodges and refactor |
01:55:17 | FromDiscord | <Technisha Circuit> Oh |
01:55:22 | disruptek | reduce the amount of code. |
01:55:33 | disruptek | while making it more expressive. |
01:55:43 | FromDiscord | <Technisha Circuit> Okay then :p |
01:55:52 | FromDiscord | <Elegant Beef> It's hard to write clean code when you dont know where the code will go |
01:55:54 | FromDiscord | <Elegant Beef> 😄 |
01:56:10 | FromDiscord | <Elegant Beef> I might need this, oh wait i dont need this anymore |
01:58:01 | FromDiscord | <Technisha Circuit> :p |
01:58:34 | FromDiscord | <Technisha Circuit> It's also hard when you are working with 2 other people who have different styles of writing code :P |
01:58:40 | FromDiscord | <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:59 | disruptek | do they not have arson where you live? |
01:59:34 | giaco | can you list for me the "quasi-alternative(s)" to nim that you know? I'm googling dart and haxe |
01:59:57 | disruptek | i would say that compilation involves a loss of information, too. |
02:00:06 | disruptek | information that is not useful to the computer. |
02:00:38 | disruptek | ie. to reverse the process requires injecting new information. |
02:00:40 | FromDiscord | <Technisha Circuit> > do they not have arson where you live?↵? |
02:00:51 | disruptek | burn their fucking houses to the ground. |
02:01:01 | FromDiscord | <Technisha Circuit> Uhhhhhhh |
02:01:29 | FromDiscord | <Technisha Circuit> @codic @Synth |
02:01:36 | FromDiscord | <Elegant Beef> A single project should have a single convention |
02:01:45 | FromDiscord | <Elegant Beef> If it doesnt everyone learn how to fucking follow a convention |
02:01:51 | FromDiscord | <Technisha Circuit> Where do you guys live I'ma burn your houses down- |
02:01:53 | FromDiscord | <Technisha Circuit> xD |
02:02:01 | FromDiscord | <Technisha Circuit> Read from https://discord.com/channels/371759389889003530/371759389889003532/720456915561480296 down |
02:02:03 | FromGitter | <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:46 | disruptek | there's talk of making it work with system-provided z3 library, if that's what you mean. |
02:02:49 | FromDiscord | <Synth> WHat happened?↵= |
02:02:53 | * | aeverr quit (Read error: No route to host) |
02:02:57 | FromDiscord | <Synth> > @codic @Synth↵@Technisha Circuit What happened? |
02:03:05 | FromDiscord | <codic> I'd say probably https://discordapp.com/channels/371759389889003530/371759389889003532/720457493867790379 |
02:03:07 | FromDiscord | <Technisha Circuit> > Read from https://discord.com/channels/371759389889003530/371759389889003532/720456915561480296 down |
02:03:07 | * | chemist69 quit (Ping timeout: 260 seconds) |
02:03:13 | FromDiscord | <codic> ^^ nvm |
02:03:21 | FromDiscord | <Technisha Circuit> xD |
02:03:22 | FromDiscord | <Elegant Beef> Im sure IRC loves all these links guys |
02:03:25 | FromDiscord | <Synth> ;-; |
02:03:26 | disruptek | not really sure which package manager you're refering to. |
02:03:28 | * | Tlanger quit (Quit: Leaving) |
02:03:28 | FromDiscord | <codic> What do you mean different styles? |
02:03:32 | FromDiscord | <Technisha Circuit> I'm sure they do :3 |
02:03:36 | * | aeverr joined #nim |
02:03:49 | FromDiscord | <Technisha Circuit> We have different styles writing the code as in we write it differently |
02:04:00 | FromDiscord | <codic> Yes, I'm not dense |
02:04:08 | FromDiscord | <codic> I mean, what specifically are you referring to |
02:04:41 | * | chemist69 joined #nim |
02:04:51 | FromGitter | <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:33 | disruptek | well, 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:40 | FromDiscord | <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:53 | FromDiscord | <codic> I do use let and const |
02:05:56 | FromDiscord | <codic> I definetely don't avoid them |
02:06:03 | FromDiscord | <Technisha Circuit> You use let over const :P |
02:06:22 | FromDiscord | <Elegant Beef> Oh no explict types, god the code base will suffer! 😄 |
02:06:27 | FromDiscord | <Technisha Circuit> I use const where possible so the variable is defined at compile time :P |
02:06:36 | FromDiscord | <Technisha Circuit> I use explicit types too |
02:06:42 | FromDiscord | <Technisha Circuit> :P |
02:06:43 | FromDiscord | <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:48 | FromDiscord | <codic> !!.toLower() |
02:06:58 | FromDiscord | <Technisha Circuit> Nah, I don't |
02:06:59 | disruptek | whoa |
02:07:03 | FromDiscord | <Technisha Circuit> xD |
02:07:07 | FromDiscord | <codic> hey i did say `!!.toLower()` |
02:07:14 | FromDiscord | <codic> even though that's not valid nim |
02:07:23 | FromDiscord | <codic> more of a combination of bash and nim |
02:07:25 | FromDiscord | <Technisha Circuit> I need to burn their houses down, you're right disruptek- |
02:07:29 | FromDiscord | <codic> Sure |
02:07:33 | FromDiscord | <codic> Have good luck finding me |
02:07:34 | disruptek | BTDT |
02:07:58 | FromDiscord | <Technisha Circuit> Hahaha |
02:08:05 | FromDiscord | <codic> Stop the arson |
02:08:09 | disruptek | look for the girl standing on her roof with a hose in hand. |
02:08:12 | FromDiscord | <codic> Stop the murder, the horrible murder |
02:08:13 | FromDiscord | <codic> Wtf |
02:09:08 | FromDiscord | <Technisha Circuit> :P |
02:09:17 | FromDiscord | <Elegant Beef> Im amazed 3 people cant talk and design about the practises and paradigms they're working on |
02:09:37 | FromDiscord | <Technisha Circuit> Wdym? |
02:09:57 | FromGitter | <deech> disruptek, why do you say that? I've been looking at it. |
02:10:08 | FromGitter | <deech> It's a nice project. |
02:10:32 | FromDiscord | <Elegant Beef> Im commenting on the fact you an issues with the other people you're working with |
02:10:41 | FromDiscord | <Elegant Beef> you have issues* |
02:10:46 | disruptek | i 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:33 | disruptek | giaco: 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:24 | disruptek | giaco: also, what platform are you developing for? |
02:13:16 | FromGitter | <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:43 | disruptek | well, i've added some bugs to the tracker recently. please let me know if i missed anything. 😉 |
02:13:53 | disruptek | and, thanks for checking it out. |
02:14:17 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:14:17 | disruptek | it needs more users but it's so annoying to use right now because of the nimscript/config changes. |
02:14:29 | disruptek | slower and spammier than it used to be... |
02:14:56 | giaco | disruptek: 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:18 | giaco | disruptek:do you have any opinion on haxe, or dart, or red? |
02:15:50 | FromDiscord | <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:00 | disruptek | dart is dead afaik, haxe is not focused enough imo. i don't know red. |
02:16:03 | FromDiscord | <Technisha Circuit> Also, my special irl talent is pissing people off |
02:16:13 | * | muffindrake joined #nim |
02:16:18 | disruptek | we have a guy here that came from haxe. it's pretty esoteric, still. |
02:16:52 | FromDiscord | <Technisha Circuit> Has anyone made another backend for Nim that isn't based off of JS, C, C++ or ObjC? |
02:17:03 | FromDiscord | <Technisha Circuit> (edit) 'JS, C, C++' => 'JS' | 'ObjC?' => 'something?' |
02:17:12 | FromDiscord | <Technisha Circuit> I'm just curious |
02:17:13 | disruptek | targing 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:17 | FromDiscord | <Synth> I use const whenever I can :p |
02:17:44 | FromDiscord | <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:45 | FromDiscord | <Technisha Circuit> Synth is a good boy |
02:17:46 | disruptek | i write a lot of code, so i need to be able to read a lot of code. i would rather read nim. |
02:17:50 | FromDiscord | <Synth> No, you're silly |
02:18:13 | disruptek | there's an llvm ir backend. |
02:18:14 | FromDiscord | <Technisha Circuit> You are though |
02:18:21 | FromDiscord | <Technisha Circuit> Oh? |
02:19:09 | FromDiscord | <Elegant Beef> If you dont like rust use nim |
02:19:16 | FromDiscord | <Elegant Beef> Problem solved 😄 |
02:21:07 | giaco | disruptek: I don't follow your "targing rpi eliminates most competition. i'd say rust is probably the only language i would consider". |
02:21:36 | giaco | disruptek: are you saying that nim is not a possible alternative to build native code for pi? |
02:21:47 | disruptek | nim 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:19 | disruptek | you can build the nim compiler on an pi. |
02:22:24 | FromDiscord | <Technisha Circuit> Inim is a solution for the repl issuue |
02:22:28 | FromDiscord | <Technisha Circuit> (edit) 'issuue' => 'issue' |
02:22:32 | disruptek | yes, you can build any nim software you want to run there. |
02:22:57 | FromDiscord | <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:01 | FromDiscord | <Elegant Beef> Nim reads and write easily whist not comprimising on functionality |
02:23:26 | disruptek | targetting rpi eliminates a lot of other languages that just aren't good choice for embedded. |
02:23:27 | FromDiscord | <Technisha Circuit> Also @Synth doesn't like Rust anymore |
02:23:41 | FromDiscord | <Technisha Circuit> Explain why please Synth :P |
02:23:58 | FromDiscord | <Rika> I am depressed, my keyboard is broken |
02:24:07 | FromDiscord | <Rika> Will I have to become technicae |
02:24:12 | FromDiscord | <Elegant Beef> Well be happy you can spell derpessed still |
02:24:16 | FromDiscord | <Technisha Circuit> Bruh, I've been depressed for god knows how many years |
02:24:17 | FromDiscord | <Elegant Beef> depressed* 😄 |
02:24:17 | disruptek | sounds like your keyboard is depressed. |
02:24:19 | FromDiscord | <Synth> > If you dont like rust use nim↵@Elegant Beef Same, I switched to Nim from Rust |
02:24:19 | FromDiscord | <Rika> I don't wanna be another technicae |
02:24:31 | FromDiscord | <Technisha Circuit> Use your laptop then @Rika |
02:24:35 | FromDiscord | <Rika> @Elegant Beef have you heard of a phone |
02:24:40 | FromDiscord | <Elegant Beef> No |
02:24:43 | FromDiscord | <Rika> @Technisha Circuit good point |
02:24:44 | FromDiscord | <Elegant Beef> Mine's a paperweight |
02:24:54 | FromDiscord | <Technisha Circuit> People who started programming on PC won't be able to use a mobile to code |
02:24:59 | FromDiscord | <Rika> I'll prolly just laze around until I buy a replacement tho |
02:25:01 | FromDiscord | <Elegant Beef> The last practical thing i did on my phone was use it for a email notifiier |
02:25:03 | FromDiscord | <Technisha Circuit> It'll be too hard of a switch for them |
02:25:03 | FromDiscord | <Elegant Beef> Or a clock |
02:25:07 | FromDiscord | <Rika> @Technisha Circuit I've done it |
02:25:18 | FromDiscord | <Technisha Circuit> Not for large programs- |
02:25:19 | FromDiscord | <Rika> It's kinda irritating but it's doable |
02:25:26 | FromDiscord | <Rika> Ssh exists lol |
02:25:38 | FromDiscord | <Elegant Beef> Well synth i didnt ever use rust, i just looked at rust and went no |
02:25:40 | FromDiscord | <Technisha Circuit> That's not from your phone then, is it? |
02:25:48 | FromDiscord | <Rika> I'll have to type on a phone |
02:25:51 | FromDiscord | <Technisha Circuit> That's using ssh |
02:25:55 | FromDiscord | <Rika> Use the phones screen |
02:26:01 | FromDiscord | <Rika> Not use a moise |
02:26:02 | FromDiscord | <Technisha Circuit> You should compile everything on your phone too |
02:26:07 | FromDiscord | <Technisha Circuit> Then you'll know my pain |
02:26:14 | FromDiscord | <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:16 | FromDiscord | <Rika> Okay |
02:26:23 | FromDiscord | <Rika> I don't want to know your pain |
02:26:27 | FromDiscord | <Technisha Circuit> Hahaha |
02:26:41 | FromDiscord | <Rika> I don't really care to know about your pain either so |
02:26:48 | FromDiscord | <Technisha Circuit> Also, what's a good uncommon prefix for a discord bot? |
02:26:58 | FromDiscord | <Elegant Beef> Make the nim compiler run on a Commedore 64 then see how it works for embedded |
02:27:01 | FromDiscord | <Rika> (initial of bot)~ |
02:27:13 | FromDiscord | <Elegant Beef> FuckingUselessBot |
02:27:14 | FromDiscord | <Technisha Circuit> > I don't really care to know about your pain either so↵sEe ThIs WhY i Am DePrEsSeD- |
02:27:14 | FromDiscord | <Elegant Beef> Best name |
02:27:27 | giaco | disruptek: 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:29 | FromDiscord | <Rika> Oof lmao |
02:27:44 | FromDiscord | <Technisha Circuit> The bot is called `Nimmie` |
02:27:50 | disruptek | go is actually not a bad language for certain things and certain people. |
02:27:58 | FromDiscord | <Technisha Circuit> I hate Go |
02:27:59 | FromDiscord | <Rika> @giaco mind elaborating on what makes you feel those ways for both go and rust? |
02:28:04 | FromDiscord | <Technisha Circuit> Except for it's braces |
02:28:17 | FromDiscord | <Rika> @Technisha Circuit then you're not part of those certain people |
02:28:18 | disruptek | i 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:36 | FromDiscord | <Technisha Circuit> :P |
02:28:49 | FromDiscord | <Rika> I just don't like eithers syntax lol |
02:28:52 | FromDiscord | <Elegant Beef> im picky and i see `::,->,let mut` and run |
02:29:00 | disruptek | ie. go is too simple and rust is too exhausting. |
02:29:09 | FromDiscord | <Rika> Don't forget the turbo fish or whatever they fuckin call it |
02:29:17 | FromDiscord | <Elegant Beef> let mut is infurating to me |
02:29:24 | FromDiscord | <Technisha Circuit> Wdym? |
02:29:27 | FromDiscord | <Rika> Why? |
02:29:37 | FromDiscord | <Elegant Beef> Cause it's two keywords that could be one |
02:30:06 | FromDiscord | <Elegant Beef> both kotlin and nim have a single keyword to seperate mutabillity |
02:30:46 | FromDiscord | <Elegant Beef> Unless you can force mutabillity after a variable is declared i dont see why it's not just one keyword |
02:30:51 | disruptek | giaco: do you have any other constraints, like integrations or performance requirements? |
02:31:03 | giaco | Rika: I prefer go over rust, but both lacks something I used to like and use a lot in python |
02:31:18 | disruptek | everything is a /force/ in rustland. |
02:31:43 | FromDiscord | <Technisha Circuit> :p |
02:31:50 | disruptek | a lot of python folks come to nim. it's similar on the surface, but very different. |
02:32:01 | FromDiscord | <speckledlemon> I'm a Python programmer by day/night and Rust + Nim by night. What do you use Python for? |
02:32:07 | FromDiscord | <Technisha Circuit> I came from Python and I'm loving Nim- |
02:32:14 | disruptek | with python, you're used to having to be careful when coding to achieve performance. |
02:32:21 | FromDiscord | <Elegant Beef> Nim has that thing that python doesnt, *static typing* |
02:32:35 | FromDiscord | <Technisha Circuit> I also like static typing at times |
02:32:41 | FromDiscord | <Elegant Beef> "at times" |
02:32:41 | FromDiscord | <Technisha Circuit> And not so much at others |
02:32:47 | FromDiscord | <Technisha Circuit> :P |
02:33:11 | FromDiscord | <Elegant Beef> If the time percentage isnt greater or equal to 100% you gave the wrong answer |
02:33:23 | FromDiscord | <Technisha Circuit> I just can't remember what type a proc is :P |
02:33:24 | FromDiscord | <Technisha Circuit> Wait |
02:33:27 | giaco | disruptek: 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:30 | FromDiscord | <Elegant Beef> a proc is a proc |
02:33:38 | FromDiscord | <Technisha Circuit> Is there a way to check types in Nim? |
02:33:39 | Prestige | Hm Anyone know how to turn a ptr cuchar into a string? |
02:33:45 | FromDiscord | <Elegant Beef> `type(var)` |
02:33:52 | FromDiscord | <Technisha Circuit> Oh, thanks :P |
02:33:58 | FromDiscord | <Rika> Isn't it typeof |
02:34:04 | FromDiscord | <Elegant Beef> probably |
02:34:07 | FromDiscord | <Technisha Circuit> O |
02:34:18 | FromDiscord | <Elegant Beef> Both work for int atleast |
02:34:38 | disruptek | giaco: it'll be great for that. just remember that OOP is a fad and you'll be fine. |
02:34:55 | FromDiscord | <Technisha Circuit> Could i do `var name:type(proc() = echo "Yeet")`? |
02:34:59 | FromDiscord | <Technisha Circuit> Probably not xD |
02:35:06 | giaco | disruptek: /me googling "fad" |
02:35:40 | FromDiscord | <Elegant Beef> Why would you tech |
02:35:44 | disruptek | i 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:52 | FromDiscord | <Elegant Beef> You're declaring a body and the type right there |
02:36:06 | FromDiscord | <Elegant Beef> It's a void parameterless proc and it's body is an echo |
02:36:07 | FromDiscord | <Technisha Circuit> Just curious :P |
02:36:31 | FromDiscord | <Elegant Beef> the type is literally a `proc()` |
02:36:40 | FromDiscord | <Technisha Circuit> :p |
02:37:03 | FromDiscord | <Technisha Circuit> But then i also have to do `{.gcsafe, locks:0.}` too :P |
02:37:07 | FromDiscord | <Technisha Circuit> As the pragmas |
02:37:16 | FromDiscord | <Elegant Beef> no |
02:37:47 | Prestige | Beef 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:55 | FromDiscord | <Elegant Beef> Nope that's low level shit |
02:37:58 | FromDiscord | <Elegant Beef> Im a numpty there |
02:38:16 | FromDiscord | <Elegant Beef> Tech idk what you mean↵https://play.nim-lang.org/#ix=2oRW |
02:38:19 | giaco | disruptek: the min size I've achieved with go with stripping, linkage optimization and compression is ~400kb |
02:38:20 | disruptek | what is PPcuchar? |
02:38:22 | FromDiscord | <Rika> Doesn't ppcuchar mean pointer to pointer of an unsigned char |
02:38:29 | giaco | disruptek: on x86 |
02:38:31 | Prestige | ptr ptr cuchar disruptek |
02:38:43 | FromDiscord | <Elegant Beef> It's a penisy cuchar |
02:38:44 | disruptek | some[][] |
02:39:11 | Prestige | Yeah that will get me to a cuchar |
02:39:36 | giaco | disruptek: following this guide https://blog.filippo.io/shrink-your-go-binaries-with-this-one-weird-trick/ |
02:40:00 | Prestige | But I'm not sure how to take a cuchar and a length and get the string from it |
02:40:05 | disruptek | what does a 400k go program do? |
02:40:20 | FromDiscord | <Elegant Beef> I bet it goes |
02:40:48 | disruptek | Prestige: add .cstring |
02:41:37 | Prestige | well hot damn thanks |
02:41:45 | disruptek | sure. |
02:42:00 | disruptek | giaco: i think we've managed a 3k hello world. something like that. |
02:42:41 | disruptek | there are a couple kernels in nim, a poc linux kernel module... you don't need to bundle extra stuff. |
02:43:13 | disruptek | oh, 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:05 | giaco | zip? let me google. I feel today one of those days where you discover something important |
02:45:19 | disruptek | no, zig |
02:45:29 | disruptek | ziglang.org |
02:46:05 | giaco | sorry, I mistyped. I got it right in google |
02:48:11 | FromDiscord | <Elegant Beef> How dare you mistype it you've doomed us all |
02:48:58 | disruptek | i'm not afraid of "competition" from zig. |
02:49:04 | giaco | disruptek: 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:35 | disruptek | i think the thread does a good job of explaining some reasons, right? |
02:50:02 | FromDiscord | <Elegant Beef> Lol it's 2020 and disruptek expects people to read |
02:50:22 | disruptek | i'm shouting right now. |
02:51:43 | FromDiscord | <Elegant Beef> Good |
02:52:01 | disruptek | i'm having a problem with my colon. |
02:52:19 | disruptek | colontmp__1, i mean. |
02:52:22 | FromDiscord | <Elegant Beef> Is it semi |
02:52:40 | disruptek | no, that was ages ago. |
02:53:00 | giaco | disruptek: I mean, that topic doesn't expose the point. Is it about cross compilation? |
02:53:04 | disruptek | i gave up perl after too much syntactic sugar gave me cancer of the semicolon. |
02:53:20 | disruptek | giaco: it is. and having a smaller, simpler toolchain. |
02:57:49 | giaco | disruptek: 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:57 | disruptek | sure thing. |
02:58:18 | disruptek | i think zig would make more sense if you were coming from c and just wanted something a little more ergonomic. |
02:58:29 | disruptek | but coming from python, you will love nim. |
02:58:35 | disruptek | have fun. |
02:58:40 | Prestige | hm I'm getting an illegal storage access error when trying to read a cstring.. wonder why |
02:59:02 | FromDiscord | <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:03 | disruptek | cstrings have nil terminators. |
02:59:22 | Prestige | I am just trying to convert it to a normal string with $ |
02:59:39 | Prestige | actually it's in an option and calling myOption.get throws the error, without trying to convert it |
03:00:06 | disruptek | sounds like the option is empty (none). |
03:00:25 | giaco | disruptek: 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:25 | Prestige | I am checking with isSome beforehand |
03:00:45 | FromDiscord | <Elegant Beef> well get could be an issue if it doesnt have a nil at the end and it's a cstring |
03:00:46 | FromDiscord | <Elegant Beef> but idk |
03:00:53 | disruptek | ^ |
03:00:59 | Prestige | hmm that is interesting |
03:01:09 | disruptek | use your length value to terminate it. |
03:01:14 | disruptek | with EXTREME prejudice. |
03:01:16 | FromDiscord | <Elegant Beef> Well i assume without a nil it never escapes so goes through all the memory |
03:01:29 | disruptek | laughing all the way! |
03:01:44 | disruptek | i found c# pretty nice to use, actually. |
03:01:46 | Prestige | That's a good point. Although since it's a string handled by xlib I'd think it would be nil terminated, no? |
03:01:57 | disruptek | i'm just not about clr, at least until they port it to jvm. |
03:01:58 | FromDiscord | <Rika> Might not be |
03:02:18 | FromDiscord | <Elegant Beef> port it to jvm 😄 |
03:02:28 | FromDiscord | <Elegant Beef> That's a joke right |
03:02:29 | disruptek | yes, it's not happening any time soon. |
03:02:39 | giaco | disruptek: C# is my favourite language, but is not good for scripting, or doing science, or REPL |
03:02:40 | disruptek | giaco: graalvm |
03:02:53 | disruptek | something to talk to google about. |
03:03:02 | FromDiscord | <Elegant Beef> not good for scripting, meanwhile it's used as the scripting language in Unity |
03:03:10 | FromDiscord | <Elegant Beef> Or is that programming language 😄 |
03:03:22 | disruptek | i liked it. i just hacked it, though. |
03:03:37 | disruptek | but, nim's superior. |
03:05:48 | giaco | Elegant 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:45 | FromDiscord | <Elegant Beef> I dont know what you mean but ok |
03:08:17 | giaco | disruptek: graalvm. Appropriate name, in my case |
03:10:46 | disruptek | Prestige: if you know the length, set the terminator before $'ing it. |
03:11:17 | disruptek | there are some cstring utils in a cstrutils module iirc. |
03:11:24 | Prestige | Trying that now but still getting the error - wouldn't it just be myCString[len - 1] = '\0'? |
03:11:41 | disruptek | seems likely, yes. |
03:12:03 | Prestige | hm. I feel like I must be doing something incorrectly |
03:12:05 | disruptek | make sure the length is >0. |
03:12:50 | disruptek | someone write down this number: 13956241 |
03:12:55 | disruptek | never mind. |
03:14:12 | FromDiscord | <Elegant Beef> Too late i have your SIN |
03:17:08 | Prestige | So 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:12 | disruptek | perhaps not. |
03:19:07 | disruptek | the 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:45 | disruptek | i've been protesting about it all week; maybe you've seen me at the rally in DC? |
03:20:14 | disruptek | TERMINATE STRINGS |
03:20:23 | FromDiscord | <Elegant Beef> Are you inside the babygate or outside it? |
03:20:35 | disruptek | the babygate. lol |
03:21:11 | disruptek | i can't travel as freely as i used to. |
03:21:31 | disruptek | i only fly at night, now. |
03:21:46 | FromDiscord | <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:56 | disruptek | no one sees me. |
03:21:58 | disruptek | NO ONE. |
03:23:02 | FromDiscord | <Elegant Beef> I guess you're right cause they tend to just flee |
03:23:24 | disruptek | you get one whiff and you're moving to the other side of the street, i promise. |
03:24:47 | Prestige | Okay so even trying to access myCString[0] gives me an illegal access error |
03:25:16 | disruptek | yourCString is nil, boss. |
03:25:33 | disruptek | it's okay, i have a bug in my colon. |
03:25:39 | disruptek | my colontmp__1 i mean. |
03:25:43 | Prestige | Lol |
03:25:59 | Prestige | I wonder why this isn't working just for cstrings... same code is working for other data types |
03:26:28 | disruptek | take away a [] |
03:27:40 | giaco | disruptek: graalvm is serious black magic |
03:27:56 | disruptek | it's pretty badass. |
03:28:00 | giaco | didn't know about Truffle |
03:28:38 | disruptek | i think the python impl was one of the first. |
03:31:26 | Prestige | oh 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:38 | disruptek | sure. |
03:32:54 | disruptek | alloc0(100) will give you one hundred squeaky clean bytes. |
03:33:08 | disruptek | you're going to love the way you look. |
03:33:11 | disruptek | i guarantee it. |
03:35:16 | FromDiscord | <Rika> Ngl I enjoy how disruptek speaks |
03:35:31 | disruptek | how about this comment i just added to the compiler: |
03:35:35 | disruptek | # this is kinda important; only an idiot would omit it on his first try |
03:36:09 | FromDiscord | <Rika> So did you omit it on your first try |
03:36:19 | disruptek | no comment. |
03:36:32 | giaco | disruptek: 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:36 | Prestige | Are 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:43 | FromDiscord | <Rika> They should be no? |
03:38:55 | FromDiscord | <Rika> Are you sure the pointer isn't nil? |
03:39:00 | FromDiscord | <Rika> Try printing it with repr |
03:40:26 | Prestige | I'm just trying to create a cstring then assign it to another var that is a ptr cuchar |
03:41:24 | Prestige | type mismatch: got ptr cstring but expected ptr ptr cuchar |
03:41:25 | FromDiscord | <Elegant Beef> No comment disruptek, so that means you added the comment 😄 |
03:42:33 | FromDiscord | <Elegant Beef> Just nuke it to space |
03:46:27 | FromDiscord | <Rika> Tried casting it? |
03:46:37 | Prestige | ah cstring is a ptr cchar not ptr cuchar |
03:47:18 | FromDiscord | <Rika> So what is an unsigned char anyway |
03:47:34 | Prestige | wdym? |
03:47:47 | FromDiscord | <Elegant Beef> a char is already unsigned |
03:47:48 | FromDiscord | <Elegant Beef> isnt it |
03:47:54 | FromDiscord | <Rika> Or does it mean unicode char |
03:48:23 | FromDiscord | <Elegant Beef> > Of the same size as char, but guaranteed to be unsigned. Contains at least the [0, 255] range. |
03:48:43 | FromDiscord | <Elegant Beef> char is a generic version of unsigned/signed char |
03:48:52 | FromDiscord | <Rika> So you can prolly cast it without a problem |
03:49:19 | disruptek | it means noone has written their name on it yet. |
03:49:28 | Prestige | idk 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:29 | FromDiscord | <Elegant Beef> Nah that's unhancocked |
03:49:31 | disruptek | echo cast[uint](someptr) |
03:49:45 | * | rockcavera joined #nim |
03:51:21 | disruptek | it's common to pass a ptr in to get scribbled on. |
03:51:43 | FromDiscord | <Elegant Beef> Also is this XGetWindowProperties, prestige? |
03:51:56 | Prestige | Yeah |
03:52:15 | Prestige | That is not working with cstrings with me for some reason... so I found XFetchName and that's working |
03:52:42 | FromDiscord | <Elegant Beef> Yea i couldnt figure out that proc either |
03:52:51 | FromDiscord | <Elegant Beef> Too C-ee to me |
03:52:55 | disruptek | i would take a look but i use wayland. 😜 |
03:53:01 | Prestige | I have XGetWindowProperty working for all integer types but it's doing weird shit for strings |
03:53:23 | disruptek | you can look at how i do cstring-fu in one of my projects. |
03:53:34 | Prestige | It 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:26 | disruptek | https://github.com/disruptek/gittyup/blob/master/gittyup.nim#L618 |
03:55:55 | Prestige | I 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:21 | Prestige | but 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:13 | FromDiscord | <Elegant Beef> Let's abandon old C libs, we got a few thousand people, eveyone start reimplementing! |
03:57:25 | Prestige | new wayland! |
03:57:51 | disruptek | fwiw you can omit the `return none(T)` because options default to empty. |
03:58:32 | disruptek | result = propReturn[].some |
03:59:30 | Prestige | Neat, thanks |
04:00:22 | disruptek | is it actually nil in that case? |
04:00:23 | * | rockcavera joined #nim |
04:00:28 | Prestige | Yeah, just found that out |
04:00:59 | disruptek | i really don't understand this code. |
04:01:08 | Prestige | My code or xlib? |
04:01:34 | disruptek | your code. |
04:02:05 | disruptek | lemme 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:41 | Prestige | fwiw it works with integer types |
04:03:00 | disruptek | var propReturn = cast[cstring](alloc0 200) instead of propReturn: ptr T |
04:03:37 | disruptek | i don't think you need the later cast, but you can leave it. |
04:04:08 | Prestige | That may work for cstrings but if I want to keep the proc generic I'm not sure what I should do |
04:04:14 | disruptek | oh, i see. |
04:04:17 | Prestige | maybe I'll just make another proc specifically for strings |
04:04:21 | disruptek | it's simple. make one for strings. |
04:05:02 | FromDiscord | <Elegant Beef> I mean what other values can window props have |
04:05:04 | FromDiscord | <Elegant Beef> Bools? |
04:05:08 | disruptek | propReturn.option is probably correct, but remember to dealloc the ptr in a finally around your return. |
04:05:58 | disruptek | i 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:23 | disruptek | it'll work. |
04:06:39 | * | supakeen joined #nim |
04:07:10 | disruptek | it works with ints because pointers are ints, of course. |
04:08:13 | FromDiscord | <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:32 | disruptek | it 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:58 | Prestige | Just how I like to style the code, don't have an ultawide monitor :P |
04:11:31 | disruptek | relax; some are girthy, some on long and lean. |
04:11:39 | disruptek | it's what you do with it that counts. |
04:12:15 | giaco | disruptek: thanks for the all the info, I need some sleep to wrap my head around all these news |
04:12:26 | disruptek | aight, peace out and welcome to the community. |
04:12:42 | FromDiscord | <Elegant Beef> i have a 1080p 24" monitor and i think you use 1/12th of it |
04:13:07 | disruptek | nonsense, i'm 8" on a good day. |
04:13:31 | Prestige | maybe: https://0x0.st/iVgZ.png |
04:13:43 | Prestige | easier reading for me tho |
04:15:38 | FromDiscord | <Elegant Beef> If by easier you mean more annyoing, sure! |
04:15:55 | FromDiscord | <Elegant Beef> Use columns of 1, and there you go |
04:15:57 | FromDiscord | <Elegant Beef> 😄 |
04:16:26 | Prestige | where 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:26 | bung | for js backend , can I use import syntax ? |
06:36:39 | FromDiscord | <Rika> Yeah |
06:39:27 | * | Vladar joined #nim |
06:41:24 | bung | I just tried , it resolve to nim file |
06:42:06 | bung | I meat to import from node_modules |
06:45:19 | Prestige | Is there no standard for loop in nim e.g. for i = 0, i < 10, i.inc ? |
06:46:16 | FromDiscord | <Zed> what do you mean? |
06:46:45 | Prestige | like a for loop that has an initialization, condition, and action if the condition completes (after the body) |
06:46:56 | Prestige | Like in c, java, etc |
06:47:11 | FromDiscord | <Zed> example? |
06:47:17 | FromDiscord | <Zed> in c/java |
06:47:31 | Prestige | like this: https://www.tutorialspoint.com/cprogramming/c_for_loop.htm |
06:48:11 | FromDiscord | <Zed> that's basically a normal for loop |
06:48:18 | FromDiscord | <Zed> for i in 0..<10 |
06:49:24 | Prestige | I'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:35 | PMunch | No, there is no for loop with those three specific phases (unless of course you write your own iterator) |
06:49:52 | FromDiscord | <Zed> declare the variables outside the for loop and then assign them inside the loop |
06:50:11 | Prestige | Might just make my own iterator, thought that'd be part of the language |
06:50:57 | FromDiscord | <Zed> sent a code paste, see http://ix.io/2oSe |
06:51:14 | FromDiscord | <Zed> (edit) 'http://ix.io/2oSe' => 'http://ix.io/2oSf' |
06:51:23 | FromDiscord | <Rika> @bung jsffi has a requires |
06:51:59 | PMunch | https://play.nim-lang.org/#ix=2oSg |
06:52:05 | PMunch | Prestige ^ |
06:52:10 | FromDiscord | <Rika> @Prestige no since those kinds of for loops are glorified while loops |
06:52:28 | PMunch | (That looks horrible and please don't do that please though) |
06:52:55 | * | oculuxe quit (Ping timeout: 260 seconds) |
06:52:56 | FromDiscord | <Rika> You dislike it so hard you say please twice |
06:53:10 | FromDiscord | <Zed> it's bad |
06:53:18 | PMunch | I considered adding a "please thanks" at the end as well |
06:53:33 | FromDiscord | <Zed> what does yield do? |
06:53:33 | Prestige | Yeah I'd probably do something different |
06:54:09 | * | oculux joined #nim |
06:54:20 | PMunch | "returns" a value from an iterator |
06:54:45 | Prestige | I meant something like this @Zed https://pastebin.com/eSnKW6Wc (java example) |
06:55:04 | PMunch | You 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:27 | PMunch | But yeah, since Nim for loops automatically unpacks tuples the most royale way of doing it would be to write an iterator |
06:56:46 | FromGitter | <bung87> @Rika I know that, but it requires whole module |
06:57:58 | PMunch | Prestige: https://play.nim-lang.org/#ix=2oSh |
06:58:17 | PMunch | Not as compact, but way more readable |
06:58:33 | PMunch | And you need to name your iterator.. |
06:58:44 | Prestige | yeah I might tackle that later.. trying to convert some c code to nim atm |
06:58:49 | Prestige | always fun :p |
06:59:32 | PMunch | The other option is of course to write a template that does this, but Nim isn't always as easy to one-line |
07:00:34 | FromDiscord | <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:41 | FromDiscord | <Zed> This is as compact as i could get it |
07:01:56 | FromDiscord | <Zed> you could remove alot of the spaces if you wanted to |
07:06:07 | Prestige | I feel like I shouldn't have to be manually decoding utf8.. |
07:06:22 | Prestige | trying to get emojis to render on my status bar PMunch |
07:06:24 | * | tane_ joined #nim |
07:17:08 | PMunch | Oh, nice |
07:17:14 | PMunch | But yeah, you probably shouldn't |
07:17:59 | Prestige | Yeah.. 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:43 | Prestige | PMunch: 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:06 | Prestige | or does it just need to be exposed |
07:38:33 | PMunch | Yes, pass it as a var: https://play.nim-lang.org/#ix=2oSm |
07:38:38 | PMunch | (And make it a variable) |
07:39:26 | Prestige | ah, thanks |
07:41:41 | * | fredrikhr joined #nim |
07:42:30 | * | fredrikhr quit (Read error: Connection reset by peer) |
07:47:20 | Prestige | Coming 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:42 | PMunch | Looking good! |
07:51:10 | Prestige | Thanks :) |
07:54:06 | * | tdc joined #nim |
08:03:58 | * | Trustable joined #nim |
08:32:33 | voltist | Prestige: Is that your Nim WM? |
08:32:35 | Zevv | PMunch: 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:37 | PMunch | Zevv, hmm, what part of it is it that you don't like? |
08:34:12 | PMunch | And that's the good thing about these fibers, you can easily implement your own queue :) |
08:35:53 | Zevv | well, 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:12 | PMunch | Oh you don't need it |
08:47:53 | PMunch | Its use is explicit, and it just gives you one way of using fibers |
08:48:40 | PMunch | You can also have more than one, and call one queue from a fiber scheduled in another |
08:51:02 | * | neceve_ joined #nim |
09:02:57 | Zevv | ah right |
09:10:33 | PMunch | The only thing about the queue is that it asserts a certain pattern |
09:11:47 | PMunch | Basically 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:38 | FromDiscord | <Shucks> I want a `initDefaultValuesForNotFoundKeys` option for `json.to` 😄 |
09:44:50 | * | Tlongir quit (Quit: Leaving) |
09:47:23 | FromDiscord | <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:12 | FromDiscord | <Shucks> nvm, found a pull request. this works: https://play.nim-lang.org/#ix=2oT7 |
09:56:34 | FromDiscord | <Shucks> sorry, this one https://play.nim-lang.org/#ix=2oTa |
09:56:41 | FromDiscord | <Shucks> (edit) 'works: https://play.nim-lang.org/#ix=2oT7' => 'works' |
09:58:42 | * | NimBot joined #nim |
10:17:37 | Prestige | voltist: yep that's nimdow |
10:17:44 | Prestige | Working on creating my own status bar |
10:19:38 | FromDiscord | <Zed> Prestige, How do you find nim with vim? I couldn't get the hang of not having intelli-sense |
10:20:13 | Prestige | I'm using coc-nvim with nimlsp, it's pretty good |
10:20:30 | PMunch | I use old vim with nimlsp, works pretty well as well |
10:20:32 | Prestige | Also using nim.nvim for Syntax highlighting |
10:20:52 | PMunch | But then again I've been using Nim in Vim with nothing but syntax highlighting for years.. |
10:21:15 | FromDiscord | <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:18 | FromDiscord | <Zed> huh, just testing it out now it's working, weird |
10:47:54 | FromDiscord | <Recruit_main707> can i know the name of the file where my program is? (at compile time)? |
10:48:25 | FromDiscord | <Zed> ? |
10:48:46 | FromDiscord | <Zed> what file your program is currently in? |
10:49:53 | FromDiscord | <Recruit_main707> for example, `nim c example.nim`↵and i want to generate a file with a macro, `example.txt` |
10:51:18 | FromDiscord | <Zed> i dont think i understand what your trying to do |
10:51:36 | PMunch | He wants to know the name of his module |
10:51:45 | FromDiscord | <Recruit_main707> ^ |
10:52:13 | FromDiscord | <Zed> well i think i might disappear out the backdoor |
10:52:51 | PMunch | https://stackoverflow.com/questions/29398377/unit-testing-in-nim-is-it-possible-to-get-the-name-of-a-source-file-at-compile |
10:53:15 | FromDiscord | <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:58 | Yardanico | we also have https://nim-lang.org/docs/system.html#currentSourcePath.t FYI |
11:12:03 | Yardanico | (for full path to the source file) |
11:12:17 | Yardanico | although it uses instantiation info inside anyway lol |
11:12:21 | Yardanico | it'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:54 | FromDiscord | <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:26 | Yardanico | what about https://nim-lang.org/docs/macros.html#name%2CNimNode |
11:57:41 | FromDiscord | <Recruit_main707> smh, yeah, just found it, sorry |
11:57:42 | Yardanico | it 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:50 | FromDiscord | <Technisha Circuit> Dimscord is OP imo |
12:47:05 | FromDiscord | <Technisha Circuit> Better then any Python lib for sure |
12:47:52 | FromGitter | <alehander92> is this "original poster" |
12:47:56 | FromGitter | <alehander92> or another meaning of OP |
12:48:16 | FromGitter | <Vindaar> overpowered? |
12:48:19 | Yardanico | yes |
12:48:21 | * | marnix joined #nim |
12:50:00 | FromGitter | <alehander92> so is this a good thing |
12:50:13 | FromGitter | <alehander92> or like overengineered |
12:50:26 | Yardanico | overpowered != overengineered |
12:50:29 | Yardanico | OP has a positive accent |
12:50:40 | PMunch | pls nerf |
12:50:41 | FromGitter | <Vindaar> well it's a term from video games. Usually refers to characters / skills / weapons being too strong |
12:51:14 | FromGitter | <alehander92> so like rails is OP in ruby web frameworks |
12:51:21 | FromGitter | <alehander92> or bulgaria in yoghurt |
12:51:40 | FromGitter | <alehander92> kidding about the last thing, probably there is some giant yoghurt economic battle there |
12:52:10 | livcd | Bulgaria is cool! |
12:53:54 | FromGitter | <alehander92> yeah, there is yoghurt in korea as well, right, no wonder livcd feels like that! |
12:55:02 | livcd | There is denmark yogurt in Korea |
12:55:11 | livcd | has nothing to do with denmark |
12:55:35 | FromGitter | <alehander92> hm, they had something called svar i think? |
12:56:33 | livcd | That's the literal branding name. Denmark yogurt/milk lol |
12:56:36 | FromGitter | <alehander92> skyr? smary? totally dont get it |
12:56:37 | FromGitter | <alehander92> oh yeah |
12:56:49 | FromGitter | <alehander92> i think bulgaria has that as well as a brand |
12:57:02 | FromGitter | <alehander92> like, people sell this, not sure if bulgaria owns it at all |
12:57:32 | FromGitter | <alehander92> maybe it was licensed by meiji |
12:57:48 | * | theelous3 joined #nim |
12:58:12 | FromDiscord | <Technisha Circuit> :p |
12:58:36 | FromGitter | <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:22 | FromDiscord | <Technisha Circuit> I'm asking- |
13:06:27 | FromDiscord | <Technisha Circuit> When i use `#? Code` at the start of the file, does it apply to the whole file? |
13:08:33 | PMunch | alehander92, we have something called Skyr here in Norway |
13:08:58 | PMunch | @Technisha Circuit, what do you mean? |
13:10:47 | FromGitter | <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:56 | alehander92_ | disruptek |
13:11:06 | alehander92_ | can i ask you stuff later |
13:11:39 | alehander92_ | PMunch yeah maybe that? tasted well |
13:11:51 | PMunch | Yeah it's pretty good |
13:12:13 | PMunch | @anon767, NEP-1 is the current style guide |
13:12:15 | alehander92_ | i like fruit milk overall |
13:12:33 | PMunch | https://nim-lang.org/docs/nep1.html |
13:12:38 | PMunch | ~nep1 |
13:12:38 | disbot | no footnotes for `nep1`. 🙁 |
13:12:44 | PMunch | ~nep1 is https://nim-lang.org/docs/nep1.html |
13:12:45 | disbot | nep1: 11https://nim-lang.org/docs/nep1.html |
13:12:49 | PMunch | ñep |
13:12:52 | PMunch | ~nep1 |
13:12:53 | disbot | nep1: 11https://nim-lang.org/docs/nep1.html -- PMunch |
13:12:56 | FromGitter | <anon767> is there a linter support? |
13:13:52 | PMunch | You have --styleCheck |
13:14:12 | PMunch | There's also nimfmt |
13:15:17 | FromGitter | <bung87> nimfmt? included in distrubtion? have not seen |
13:15:38 | PMunch | No, it's an external tool by federico3 |
13:15:47 | PMunch | `nimble install nimfmt` I assume |
13:15:50 | FromGitter | <bung87> found deprecated nimfix yesterday |
13:15:52 | zedeus | what about nimpretty? |
13:16:02 | alehander92_ | hmm whats the difference |
13:16:06 | alehander92_ | with nimpretty |
13:16:47 | zedeus | nimfmt uses nimpretty as a library I guess |
13:16:57 | FromGitter | <anon767> cool I try nimfmt |
13:18:16 | bung | nimpretty remove space between string args, eg "a" "b" will format as "a""b" |
13:19:42 | alehander92_ | guys how to delete `-f` in bash |
13:20:02 | PMunch | What do you mean? |
13:21:00 | alehander92_ | ok so `rm ./-f` |
13:21:20 | alehander92_ | it appeared surprisingly hard to remove a file starting with dash |
13:23:25 | PMunch | Oh, you wanted to remove a file called "-f" :P |
13:38:31 | * | kenran joined #nim |
13:40:14 | federico3 | zedeus: nimfmt uses nimpretty indeed |
13:40:37 | * | pbb_ joined #nim |
13:40:49 | * | pbb quit (Ping timeout: 272 seconds) |
13:42:50 | disruptek | you can often rm -- -f |
13:45:02 | Zevv | Yeah, that used to be one of my hobbies. Dropping files called `-rf` everywhere |
13:45:43 | disruptek | `-rf /` you mean |
13:46:03 | Zevv | cruelty comes in different forms, I guess |
13:46:10 | disruptek | lol |
13:48:48 | Yardanico | disruptek: /* |
13:49:04 | Yardanico | rm -rf / has a safe-guard nowadays |
13:49:13 | Yardanico | so either rm -rf /* or rm -rf --no-preserve-root / |
13:49:14 | zedeus | /**/* |
13:49:46 | disruptek | a safe-guard? |
13:50:41 | Yardanico | yes |
13:50:44 | Yardanico | --no-preserve-root |
13:50:48 | Zevv | let me try that! |
13:51:04 | * | Zevv left #nim ("Connection dropped") |
13:51:11 | Yardanico | LMAO |
13:51:28 | zedeus | somebody forgot to tell him --perserver-root isn't default on all distros |
13:51:36 | zedeus | --preserve-root* |
13:51:36 | disruptek | the ol' --no-preserve-root trick. right up there with alt-f4 aim assist. |
13:51:38 | * | Zevv joined #nim |
13:51:43 | Zevv | Boy am I funny or what |
13:51:53 | zedeus | very |
13:52:03 | * | PMunch *shudders* |
13:52:04 | disruptek | i had a minion's software once rm -rf / on me. |
13:53:26 | PMunch | Reminds 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:27 | Zevv | I am so old, I deleted my VAX kernel once because I didn't know what this huge file in the root was |
13:53:45 | PMunch | Haha, nice one Zevv |
13:54:02 | disruptek | i don't think it'd dc you. |
13:54:33 | Zevv | right. Your session might perfectly survive |
13:54:58 | Zevv | but we've all been there right? "ls: command not found" |
13:55:09 | disruptek | yeah. |
13:55:21 | FromGitter | <Vindaar> yup |
13:55:21 | PMunch | Don'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:36 | Yardanico | I ran rm -rf once |
13:55:38 | Zevv | I spent an intoxicated night reassembling my partition tables by hand after copying an 1.44 MB floppy image to /dev/hda |
13:55:39 | Yardanico | from some script :P |
13:55:42 | Zevv | those were the days |
13:55:50 | PMunch | That was fun, programs slowly dying, windows changing their themes before closing |
13:56:00 | disruptek | oh, right. partition tables from memory. |
13:56:03 | PMunch | Managed to log back on afterwards, but the system was pretty unusable |
13:56:05 | disruptek | how many times... |
13:56:31 | PMunch | Haha, poor partition tables |
13:57:21 | disruptek | i'm not switching to bcachefs because i cannot be bothered to compile a missing dependency from source. |
13:57:29 | disruptek | how the times have changed. |
13:57:40 | Yardanico | I switched to ZFS a few days ago btw |
13:57:54 | disruptek | yeah? |
13:57:56 | Yardanico | yes |
13:58:15 | disruptek | i deeply regret using apfs on my osx drive. |
14:05:10 | disruptek | what'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:15 | FromDiscord | <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:19 | FromDiscord | <Technisha Circuit> (edit) 'file!' => 'file?' |
14:16:57 | FromGitter | <alehander92> disruptek can we just like save the memory state of the compiler and start it |
14:16:58 | FromGitter | <alehander92> https://unix.stackexchange.com/questions/43854/save-entire-process-for-continuation-after-reboot |
14:17:24 | FromGitter | <alehander92> https://blog.thecybershadow.net/2018/11/18/d-compilation-is-too-slow-and-i-am-forking-the-compiler/ |
14:17:28 | FromGitter | <alehander92> i think some d guy did it |
14:17:54 | * | waleee-cl joined #nim |
14:20:11 | FromGitter | <alehander92> like ok this is more complicated than i imagined: but maybe just loading the forked process |
14:21:27 | FromDiscord | <bojun> Question, what is the recommend plugging for Nim in neovim? |
14:22:06 | Yardanico | https://github.com/alaviss/nim.nvim |
14:22:09 | FromGitter | <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:20 | FromGitter | <alehander92> so its not as simple as i thought so probably normal IC is better |
14:25:44 | FromDiscord | <bojun> will that conflict if I if use nimlsp by coc? |
14:25:57 | Yardanico | I don't know honestly |
14:26:11 | Yardanico | nvim uses nimsuggest directly |
14:26:39 | Yardanico | so it'll probably conflict :) |
14:26:49 | Yardanico | but with nim.nvim you should have autocompletion too |
14:26:50 | FromDiscord | <Recruit_main707> can a macro force a compile setting? ie: `--app:lib`? |
14:26:58 | Yardanico | no, a .nims file can |
14:27:06 | FromDiscord | <Recruit_main707> ok |
14:27:13 | Yardanico | configs are evaluated before the code |
14:28:43 | FromDiscord | <Recruit_main707> can i check wether app:lib is being used though? |
14:29:18 | Yardanico | yes |
14:29:34 | Yardanico | try https://nim-lang.org/docs/compilesettings.html |
14:30:07 | Yardanico | ah wait |
14:30:09 | Yardanico | there's a simpler way |
14:30:11 | Yardanico | https://nim-lang.org/docs/system.html#appType |
14:31:44 | FromDiscord | <Recruit_main707> thats really nice |
14:31:46 | FromDiscord | <Recruit_main707> thank you |
14:31:58 | Yardanico | i didnt know that exists either, just searched for it :) |
14:35:55 | FromDiscord | <bojun> Thanks Yardanico |
14:46:47 | FromDiscord | <Recruit_main707> will fmAppend create a new file if it does not exist?↵and if it doesnt, how can that be done? |
14:47:17 | Yardanico | fmReadWriteExisting ? |
14:47:28 | Yardanico | ah right not that one |
14:49:51 | * | rokups joined #nim |
14:52:12 | FromDiscord | <Recruit_main707> also, if thats even possible at runtime, i doubt it is at compile time |
14:52:28 | Yardanico | well you can always go the simple way |
14:52:33 | Yardanico | check if the file exists or not |
14:52:39 | Yardanico | and based on that either fmWrite or fmAppend |
14:55:23 | FromDiscord | <Recruit_main707> ill try that |
14:57:16 | disruptek | pass a set or `or` them together. |
14:57:48 | Yardanico | that's not how it works with os open |
14:57:56 | disruptek | alehander92: sounds kinda silly, right? |
14:57:57 | Yardanico | and it's not possible at OS level anyway |
14:58:43 | disruptek | of course it is. |
14:58:56 | disruptek | man -s 2 open |
14:59:00 | disruptek | or w/e |
14:59:07 | Yardanico | well at least not in nim then |
14:59:11 | disruptek | alehander92: you might enjoy learning about criu |
15:04:24 | FromGitter | <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:26 | FromGitter | <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:05 | disruptek | Araq: {.emit: "throw e;".} cheater |
15:38:23 | FromGitter | <alehander92> disruptek yeah i read a bit today |
15:38:24 | FromGitter | <alehander92> after this |
15:38:39 | disruptek | it's neat, right? |
15:38:54 | FromGitter | <alehander92> seems nice, and maybe adaptable |
15:39:23 | FromGitter | <alehander92> if instead of "precompiled module prelude/lib" |
15:39:40 | FromGitter | <alehander92> you have "prestarted compiler in criu" |
15:40:01 | disruptek | it's nuts for that application, though. |
15:40:13 | FromGitter | <alehander92> and a viable way to just add to the new module paths and continue from there |
15:41:10 | FromGitter | <alehander92> i guess so, i mean serializing / importing seems better but still |
15:41:14 | FromGitter | <alehander92> a funny way to look at it |
15:41:41 | FromGitter | <alehander92> i guess criu reloading might not be fast anyway |
15:42:25 | * | endragor quit (Remote host closed the connection) |
15:56:01 | FromDiscord | <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:22 | Yardanico | because of shadowing |
15:56:29 | Yardanico | you're shadowing a global variable with a proc argument |
15:56:39 | Yardanico | either rename the global "client" variable or the "client" argument |
15:58:24 | FromDiscord | <codic> Oh i'm stupid |
15:59:09 | FromDiscord | <codic> It still errors out on this line `var response : Response = hclient.post(url, headers, body)` |
15:59:21 | FromDiscord | <codic> `/home/solus/coding/tts/speech.nim(47, 38) Error: type mismatch: got <HttpClient, string, string, string>` |
15:59:40 | Yardanico | yes because headers must be set to a client instance |
15:59:48 | Yardanico | client.headers |
16:01:11 | * | Trustable joined #nim |
16:05:23 | FromDiscord | <codic> so instead of headers i used hclient.headers and now got `type mismatch: got <HttpClient, string, HttpHeaders, string>` |
16:05:32 | Yardanico | ? |
16:05:35 | Yardanico | hclient.headers = headers |
16:05:39 | Yardanico | that's how you should do it |
16:05:48 | Yardanico | and headers must be a HttpHeaders |
16:05:50 | Yardanico | not a string |
16:06:09 | Yardanico | https://nim-lang.org/docs/httpclient.html check examples here |
16:06:40 | FromDiscord | <codic> no here i have `post(hclient, url, hclient.headers, body)` so hclient.headers are HttpHeaders |
16:06:51 | FromDiscord | <codic> body and url are strings toh |
16:06:53 | FromDiscord | <codic> (edit) removed 'toh' |
16:07:01 | Yardanico | no |
16:07:02 | Yardanico | that's wrong |
16:07:11 | Yardanico | I said you need to set headers in the different place |
16:07:24 | * | kitech1- joined #nim |
16:07:26 | Yardanico | check the httpclient top examples |
16:07:34 | Yardanico | hclient.headers = newHttpHeaders(...) and then hclient.post(url, body) |
16:07:38 | * | kitech1 quit (Ping timeout: 260 seconds) |
16:07:43 | FromDiscord | <codic> Ohhhh |
16:08:19 | * | a_chou joined #nim |
16:09:18 | FromDiscord | <codic> Okay now it compiles |
16:09:22 | FromDiscord | <codic> Running get https://hatebin.com/efcejjnoft |
16:09:28 | FromDiscord | <codic> get == it gets |
16:09:42 | Yardanico | are you sure the URL still works? |
16:10:07 | FromDiscord | <codic> > 400: Your client has issued a malformed or illegal request. Missing parameter: key That’s all we know. |
16:10:18 | Yardanico | well that's not a problem with nim :) |
16:10:21 | FromDiscord | <codic> so I have to add the key header :p |
16:10:38 | FromDiscord | <codic> please work |
16:10:48 | FromDiscord | <codic> yeah, same error... |
16:11:16 | FromDiscord | <codic> is there another lib i can use for speech-to-text? |
16:13:17 | Yardanico | idk :) |
16:18:11 | * | marnix quit (Ping timeout: 256 seconds) |
16:26:08 | bung | 400 error response from service side |
16:26:29 | FromDiscord | <Zachary Carter> does anyone know of a way to declare a sequence whose members have specific alignment requirements? |
16:26:50 | FromDiscord | <Zachary Carter> or should I just use pointers? |
16:27:25 | disruptek | there is an alignment pragma but i've never used it. you could just pad the member types, i guess. |
16:27:37 | FromDiscord | <Zachary Carter> alignment pragma doesn't work on types though |
16:27:42 | FromDiscord | <Zachary Carter> only variables and object fields |
16:27:43 | disruptek | what would a pointer do for you? |
16:27:55 | disruptek | i think i don't understand the question. |
16:29:00 | FromDiscord | <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:44 | FromDiscord | <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:47 | disbot | ➥ semcheck fails while trying to instantiate an unused module for no reason ; snippet at 12https://play.nim-lang.org/#ix=2oUO |
16:30:17 | FromDiscord | <Zachary Carter> or make the `align` pragma work on types |
16:30:27 | FromDiscord | <Zachary Carter> but I'll just pad like you suggested for now |
16:30:39 | bung | can I dump c struct ? am not sure am reading the right version source file |
16:31:33 | disruptek | dump it? it's just memory. |
16:31:47 | disruptek | types are just semantics; they don't exist at runtime. |
16:31:57 | disruptek | so i dunno what an alignment pragma would mean there. |
16:32:02 | bung | when I echo the struct `error: variable has incomplete type 'struct pri'` so am wrapping wrong ? |
16:32:49 | FromDiscord | <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:00 | FromDiscord | <Zachary Carter> which I realize is compiler implementation specific |
16:33:21 | FromDiscord | <Zachary Carter> so I guess codgenDecl is the way to go - if it were to work with type definitions |
16:34:00 | disruptek | afaik, it does. |
16:34:12 | disruptek | bung: can you show some code? |
16:34:13 | FromDiscord | <Zachary Carter> it doesn't |
16:34:21 | * | a_chou quit (Quit: a_chou) |
16:34:26 | FromDiscord | <Zachary Carter> unless something just recently changed |
16:36:36 | bung | yeah , you working on mac? |
16:36:40 | disruptek | nope. |
16:36:59 | disruptek | `working` is too strong a word for what i do. |
16:37:21 | bung | https://github.com/juancarlospaco/psutil-nim/blob/4acb5c72ae01759e69b057d0e9fa20634d03ff0b/src/psutil/arch/osx/socket.nim#L150 |
16:37:44 | bung | months ago work, I wonder if I can fix |
16:38:23 | disruptek | there's an incompleteStruct pragma. i never bothered to learn how it works, but i've used it and you can, too. |
16:39:05 | FromDiscord | <Zachary Carter> lol |
16:40:46 | bung | incompleteStruct to pri or socket_info ? |
16:40:52 | bung | or both |
16:41:00 | FromDiscord | <Zachary Carter> pri is the incomplete struct no? |
16:41:07 | FromDiscord | <Zachary Carter> look at the C code you're wrapping |
16:42:03 | bung | pri is incomplete ,but there's hack_to_avoid_copying_more_structs , I dont rember who wrote this. |
16:43:07 | FromDiscord | <Zachary Carter> well then slap that bad boy on pri |
16:43:11 | FromDiscord | <Zachary Carter> because that's the incomplete struct 🙂 |
16:43:17 | FromDiscord | <Zachary Carter> and yes that is some hack |
16:45:44 | bung | when 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:34 | FromDiscord | <Zachary Carter> all `incompleteStruct` does is - https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-incompletestruct-pragma |
16:50:04 | FromDiscord | <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:13 | FromDiscord | <Zachary Carter> maybe just don't echo it? |
16:53:43 | bung | sounds reasonable, but the problem is I cant get soi_family it always 0 |
16:56:30 | bung | how you usually wrap the c lib, I search it through search engine and read from opensource.apple.com |
16:56:38 | FromDiscord | <Zachary Carter> I don't know enough about psutil or those bindings to really help much more |
16:56:50 | FromDiscord | <Zachary Carter> I use nimterop or roll them by hand |
16:57:04 | FromDiscord | <Zachary Carter> sometimes with the aid of c2nim |
16:58:00 | FromGitter | <brentp> hi, for objects, system.`$` works automatically. for ref objects, no. how can i deref a ref object to get a repr? |
16:58:04 | bung | hmm, maybe I just need find out where the c header file located. |
16:58:36 | FromDiscord | <Zachary Carter> brentp: `refObj[]` |
16:59:10 | FromDiscord | <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:52 | FromGitter | <brentp> @zacharycarter cheers. |
17:00:02 | FromDiscord | <Zachary Carter> https://opensource.apple.com/source/xnu/xnu-201/bsd/sys/socket.h.auto.html |
17:00:21 | FromDiscord | <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:46 | FromDiscord | <Zachary Carter> an enum is not a set |
17:00:54 | disruptek | don't be rude. |
17:01:20 | FromDiscord | <Zachary Carter> if `kind` is defined with a type of the `enum` |
17:01:29 | FromDiscord | <Zachary Carter> this check should happen at compile time and isn't necessary at runtime |
17:01:53 | FromDiscord | <Zachary Carter> or you can create a `set` with enum values and then perform the not in check |
17:02:40 | bung | oh, right, it's coming from proc_info.h |
17:03:02 | Zevv | eh Zachary, where did you end up now? Back to the USA? |
17:03:36 | FromDiscord | <Zachary Carter> yeah - I'm in Austin TX |
17:03:48 | FromDiscord | <Zachary Carter> but once I'm married I want to go back to Europe |
17:04:07 | FromDiscord | <Zachary Carter> if any country will take people from the US at that point |
17:04:14 | FromDiscord | <Zachary Carter> might be stuck here forever |
17:06:19 | Zevv | marry a european girl :) |
17:06:24 | Zevv | that's what I did. |
17:06:28 | Yardanico | lol |
17:06:32 | Zevv | Oh no, I didn.t. She's swiss |
17:06:42 | FromDiscord | <Zachary Carter> I came back for an American girl |
17:06:46 | FromDiscord | <Zachary Carter> I guess I screwed up |
17:06:48 | FromDiscord | <Zachary Carter> 😛 |
17:06:50 | Zevv | Yeah people from the US. I'll think about it, but no promises |
17:06:51 | FromDiscord | <Zachary Carter> don't tell her I said that please |
17:07:25 | FromDiscord | <Rika> Calling her right now. |
17:07:27 | FromDiscord | <djazz> 🍿 |
17:07:35 | Zevv | You do know that the percepted IQ of all US citizes has dropped quite a bit over the last few years, right? |
17:07:42 | Zevv | and I *know* you can't help it. But still. |
17:08:03 | Zevv | You were cool and all when you were still on this side. But now, I don't know anymore :) |
17:08:08 | FromDiscord | <Zachary Carter> hahaha |
17:08:18 | FromDiscord | <Zachary Carter> I've always maintained that we're a country full of simpletons |
17:08:45 | FromDiscord | <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:52 | FromDiscord | <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:58 | FromDiscord | <Zachary Carter> if they ever get funded |
17:10:04 | FromDiscord | <djazz> _is quite happy with his bordic country. Mostly. Not perfect_ |
17:10:11 | FromDiscord | <djazz> Nordic* |
17:10:24 | FromDiscord | <Zachary Carter> yeah I miss Finland |
17:10:29 | FromDiscord | <Rika> Bordic |
17:10:37 | FromDiscord | <Zachary Carter> I was confused for a moment a well |
17:11:32 | FromDiscord | <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:00 | FromDiscord | <Zachary Carter> I have not |
17:12:21 | FromDiscord | <Zachary Carter> but I'm an American who found love in the US, moved to Finland and then back to the US |
17:12:34 | FromDiscord | <djazz> Alright |
17:12:43 | FromDiscord | <Zachary Carter> maybe I should write a book |
17:12:58 | FromDiscord | <Zachary Carter> could call it the American theory of love and why you should just stay in Finland |
17:13:10 | Zevv | "Nim for dummies", and sell it in the USA |
17:13:11 | FromDiscord | <djazz> XD |
17:13:16 | Zevv | haha I am so funny |
17:13:26 | Zevv | second time today, even |
17:13:27 | FromDiscord | <Zachary Carter> oh yeah - we need a dummies Nim book for sure |
17:13:30 | Yardanico | Zevv: 👏👏👏👏👏 |
17:13:48 | Yardanico | :rofl: :lmao: :100: :fire: |
17:13:55 | FromDiscord | <Zachary Carter> is there a `how to write a dummies book for dummies`? |
17:13:57 | Yardanico | :laughing: |
17:17:52 | FromDiscord | <Recruit_main707> > create a `set` with enum values↵how is that? |
17:20:58 | Zevv | recruit_main707: https://play.nim-lang.org/#ix=2oUW |
17:21:00 | Zevv | does that help |
17:21:02 | Yardanico | {a, b, c} |
17:22:26 | Zevv | Yardanico: I get the "Yar" and the "dan" part, is the "ico" merely eastetic or is that your middle nmae? |
17:22:33 | FromDiscord | <Recruit_main707> ok |
17:22:35 | FromDiscord | <Recruit_main707> thx |
17:23:30 | Yardanico | Zevv: that's esoteric, but I think you're the first one who guessed where "Yar" and "Dan" come from :D |
17:23:36 | Yardanico | I just wanted a good suffix for the nickname |
17:23:44 | Zevv | your suffix is my first name |
17:24:03 | Yardanico | it's pretty dumb to use my real name/surname though, IDK why i made it that way |
17:24:19 | Yardanico | although it's not easy to guess |
17:27:22 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
17:27:40 | Zevv | well, it is, apparently :) |
17:30:01 | FromGitter | <antonkatz> Hi all! Just discovered NIm and instantly got the urge to start writing in it. |
17:30:15 | Zevv | well, what's stopping you! :) |
17:30:38 | FromGitter | <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:42 | FromGitter | <antonkatz> Why is that? |
17:31:28 | FromDiscord | <Zachary Carter> a lot of the stdlib doesn't really apply to JS |
17:31:52 | FromDiscord | <Zachary Carter> unless you're targeting NodeJS |
17:32:03 | Zevv | but that's kind of silly. |
17:32:14 | FromDiscord | <djazz> There is a DOM module right? |
17:32:17 | FromDiscord | <Zachary Carter> yes |
17:32:22 | Zevv | The 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:47 | FromDiscord | <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:06 | Zevv | technically, some things also don't port to JS because there's no things like pointers and raw memory |
17:33:45 | FromDiscord | <djazz> I am mainly a JS guy but I have yet to try nim to JS heh |
17:33:52 | FromDiscord | <Zachary Carter> JS is the worst |
17:34:19 | FromDiscord | <djazz> >_> |
17:34:23 | FromDiscord | <Zachary Carter> I wish I could unlearn everything I knew about the web |
17:34:27 | Zevv | yeah, I see Nim-JS as a kind of happy coincedence. Bobrossian compilation. |
17:34:29 | FromGitter | <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:53 | Zevv | we have a pretty cool parser generator that runs on js |
17:34:55 | FromGitter | <antonkatz> As far as targeting node -- in the context of serverless (AWS Lambda Google Functions) it's useful |
17:35:16 | FromDiscord | <Zachary Carter> you can write Nim lambdas that compile to C |
17:35:33 | FromDiscord | <djazz> Yeah |
17:35:54 | FromDiscord | <djazz> On the server, if you can, just skip node if you are using nim anyways |
17:36:06 | FromGitter | <antonkatz> Kinda, since neither Google nor Amazon provide proper C support (amazon does but it's a pain) |
17:36:11 | FromDiscord | <djazz> Server, serverless whatever xD |
17:36:47 | FromGitter | <antonkatz> I love serverless because then I can be just a programmer, and not a sys-admin |
17:36:50 | FromDiscord | <Zachary Carter> hmmm? |
17:36:59 | FromDiscord | <Zachary Carter> I just wrote a lambda with the serverless framework on AWS |
17:37:06 | FromDiscord | <Zachary Carter> in Nim targeting the C backend |
17:37:16 | FromGitter | <antonkatz> tell me more |
17:37:34 | FromDiscord | <Zachary Carter> well I probably still have the project on my hd let me see |
17:37:51 | FromGitter | <antonkatz> this? https://www.serverless.com/ |
17:37:57 | FromDiscord | <Zachary Carter> yes |
17:38:08 | FromGitter | <antonkatz> free version or paid? |
17:38:43 | FromDiscord | <Zachary Carter> free |
17:38:50 | FromDiscord | <Zachary Carter> https://github.com/lambci/awslambda.nim - there's this |
17:39:35 | FromDiscord | <Zachary Carter> and https://github.com/epiphone/serverless-nim |
17:39:55 | Zevv | Why does 2020 lambda feel so similar to 1993 CGI |
17:40:00 | Zevv | have we gone full circle? |
17:40:00 | FromDiscord | <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:14 | FromDiscord | <Zachary Carter> pretty much |
17:40:30 | Zevv | I had disruptek try to explain me what lambda is, because I just couldn't understand |
17:40:33 | Zevv | he failed I guess |
17:40:53 | disruptek | yay, someone is using atoz. |
17:40:57 | FromDiscord | <djazz> only serverless stuff i've done is some with Netlify Functions |
17:41:04 | FromDiscord | <Zachary Carter> lambda is CGI but it scales |
17:41:09 | FromDiscord | <Zachary Carter> and it still has all the pain points |
17:41:11 | Zevv | scaling is so overrated |
17:41:29 | disruptek | api gateway is cgi but it scales. |
17:41:35 | disruptek | lambda can be attached to anything. |
17:41:46 | disruptek | streams, database triggers, pub/sub, anything. |
17:41:53 | FromDiscord | <Zachary Carter> okay fair enough |
17:42:02 | * | nsf quit (Quit: WeeChat 2.8) |
17:42:54 | FromDiscord | <djazz> also been using PHP for ages, and that is basically serverless too |
17:43:00 | FromDiscord | <djazz> hehe |
17:43:06 | disruptek | i am thinking of doing some auctionhero work again. it'd be a good place to demo all the aws stuff i do. |
17:43:40 | FromGitter | <antonkatz> @zacharycarter do I have to use both the repositories to get it going on lamda? Or just the first? |
17:44:02 | FromDiscord | <Zachary Carter> well the second one I linked is geared towards the serverless framework |
17:44:13 | FromDiscord | <Zachary Carter> if you want to just use lambda without serverless - don't use the second |
17:44:22 | * | kenran_ joined #nim |
17:44:51 | FromDiscord | <djazz> serverless' name cause confusion heh |
17:46:48 | FromGitter | <antonkatz> @zacharycarter setting up without `serverless` framework will be a pain, so will use both |
17:47:05 | FromGitter | <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:12 | FromDiscord | <djazz> good luck! |
17:47:24 | FromGitter | <antonkatz> Thank you! |
17:47:43 | FromGitter | <antonkatz> PS. What IDE do you use? |
17:48:18 | FromDiscord | <djazz> I use VSCode |
17:48:55 | FromDiscord | <Zachary Carter> I don't use an IDE - I use kakoune |
17:50:19 | FromDiscord | <Zachary Carter> but yeah - I think most folks use VSCode however some use emacs, a lot use vim |
17:50:43 | FromDiscord | <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:37 | FromGitter | <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:32 | FromDiscord | <Zachary Carter> yeah - it's just very resource heavy |
18:00:06 | FromDiscord | <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:27 | FromDiscord | <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:32 | FromDiscord | <Zachary Carter> !repo intellij |
18:00:34 | disbot | https://github.com/judasn/IntelliJ-IDEA-Tutorial -- 9IntelliJ-IDEA-Tutorial: 11IntelliJ IDEA 简体中文专题教程 15 15856⭐ 6617🍴 7& 29 more... |
18:00:44 | FromDiscord | <Zachary Carter> !repo nim intellij |
18:00:46 | disbot | https://github.com/jhspetersson/idea-nim -- 9idea-nim: 11Nim language support for Intellij IDEA by JetBrains 15 22⭐ 1🍴 7& 5 more... |
18:00:50 | FromDiscord | <Zachary Carter> there you go |
18:06:43 | FromGitter | <antonkatz> Sweet. |
18:06:56 | FromGitter | <antonkatz> You guys are super helpful. Awesome onboarding experience. |
18:15:38 | bung | finally 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:08 | FromDiscord | <Recruit_main707> that intellij plugin only has syntax highlight iirc |
18:24:34 | FromDiscord | <Recruit_main707> there was a newer one, but it seems to havent been updated already |
18:26:11 | FromGitter | <antonkatz> PS. How is debugging experience with Nim? |
18:27:43 | * | Tyresc joined #nim |
18:31:41 | FromDiscord | <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:33 | FromDiscord | <Zachary Carter> I'd get comfortable with gdb / lldb for debugging Nim |
18:34:50 | FromDiscord | <djazz> going to work some on my web framework and stream it <https://www.twitch.tv/daniel_hede/> |
18:35:03 | FromDiscord | <Zachary Carter> what web framework is this? |
18:35:05 | FromDiscord | <djazz> source https://github.com/daniel-j/koan |
18:35:30 | FromDiscord | <djazz> will work more on the router stuff |
18:35:54 | FromDiscord | <djazz> im porting the koa node module to nim |
18:41:17 | FromDiscord | <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:26 | FromDiscord | <Technisha Circuit> Yes this is for my bot |
18:41:37 | FromDiscord | <Technisha Circuit> So i need to turn the exception into a string |
18:45:03 | * | aeverr quit (Ping timeout: 260 seconds) |
18:47:25 | Yardanico | e.msg |
18:58:30 | * | aeverr joined #nim |
19:00:35 | * | marnix joined #nim |
19:08:32 | * | waleee-cl joined #nim |
19:17:02 | disruptek | the throbbing is fierce today. |
19:17:18 | Yardanico | so I forgot, is there a way to understand where an "Exception" comes from when I do {.raises: [].} ? |
19:17:53 | disruptek | probably not. |
19:18:11 | Yardanico | ah {.effects.}, but it's not easy to insert it recursively :P |
19:21:19 | Yardanico | ohh I understood why |
19:21:32 | Yardanico | it's because my lib allows for user-defined functions |
19:21:44 | Yardanico | and since the compiler doesn't know what they'll throw it assumes "Exception" |
19:21:59 | disruptek | yeah, this is only half the problem, though. |
19:43:27 | * | aeverr quit (Ping timeout: 265 seconds) |
19:48:58 | * | aeverr joined #nim |
19:49:27 | FromDiscord | <djazz> tables have a toTable proc, but how do you convert it to a seq of tuples? |
19:49:43 | disruptek | toSeq pairs |
19:50:03 | FromDiscord | <Technisha Circuit> > e.msg↵Thanks |
19:50:35 | FromDiscord | <djazz> I have a `Table[string, string]` that I want to become something that `openArray[(string, string)]` accepts |
19:50:50 | FromDiscord | <djazz> pairs is an iterator |
19:50:58 | disruptek | /toSeq/ pairs |
19:51:08 | FromDiscord | <djazz> combined? ah |
19:51:49 | FromDiscord | <Rika> Still wish templates and macros worked with ufcs |
19:56:59 | FromDiscord | <Technisha Circuit> How do I catch all errors? |
19:57:07 | FromDiscord | <Technisha Circuit> (edit) 'errors?' => 'errors in Nim?' |
19:59:24 | FromDiscord | <Rika> Bare except |
19:59:24 | Yardanico | "try: stuff" |
19:59:27 | Yardanico | except: stuff |
19:59:53 | FromDiscord | <Rika> Are defects still catchable by default |
19:59:58 | Yardanico | by default yes |
20:00:01 | Yardanico | for backwards compat |
20:00:15 | Yardanico | --panics:on to make them unrecoverable |
20:00:16 | FromGitter | <alehander92> interesting what is the flag |
20:00:18 | FromGitter | <alehander92> ah ok |
20:00:19 | FromDiscord | <Technisha Circuit> I need to be able to get the error message though |
20:00:21 | FromGitter | <alehander92> does it quit |
20:00:25 | FromDiscord | <Rika> Oh nice kinda wanna make that default |
20:00:25 | Yardanico | @Technisha getCurrentExceptionMsg() |
20:00:31 | FromGitter | <alehander92> wow fast |
20:00:37 | FromDiscord | <Technisha Circuit> Inside an except block? |
20:00:39 | Yardanico | yes |
20:00:42 | Yardanico | https://nim-lang.org/docs/system.html#getCurrentExceptionMsg |
20:00:45 | FromDiscord | <Technisha Circuit> Thanks! |
20:00:50 | FromGitter | <alehander92> or except CatchableError as e: |
20:00:58 | Yardanico | yeah |
20:00:58 | disruptek | does your phone have a web-browser? |
20:01:01 | FromGitter | <alehander92> i *think* the second one might be pure-r |
20:01:03 | FromDiscord | <Rika> Won't catch defects tho |
20:01:09 | Yardanico | @Rika and that's good |
20:01:14 | FromDiscord | <Rika> Yeah |
20:01:14 | Yardanico | catching "Exception" is bad |
20:01:27 | FromDiscord | <Rika> It's just an fyi |
20:03:07 | FromGitter | <timotheecour> Can anyone please review https://github.com/nim-lang/Nim/pull/14634 ? it should fix a very flaky test |
20:03:10 | disbot | ➥ fix #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:23 | disruptek | !last clyybber |
21:32:24 | disbot | clyybber spoke in 12#nim-offtopic 4 days ago |
21:33:07 | disruptek | !last varriount |
21:33:08 | disbot | Varriount 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:24 | FromDiscord | <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:53 | Yardanico | well as I said for 100% certainty use GC_ref and GC_unref |
22:02:59 | Yardanico | GC_ref when passing the object to python |
22:03:12 | Yardanico | GC_unref when destroying it on nim side (with a call from python) |
22:03:20 | FromDiscord | <Recruit_main707> but its not a `ref object` |
22:03:24 | Yardanico | so? |
22:03:26 | Yardanico | GC_ref is not about ref objects |
22:03:31 | Yardanico | it's about refcounts |
22:03:42 | Yardanico | @Recruit_main707 ah wait |
22:03:45 | Yardanico | wdym not a ref object |
22:03:50 | Yardanico | if it's not a ref object then it's a value type |
22:04:03 | Yardanico | but you pass it by pointer don't you |
22:04:09 | FromDiscord | <Recruit_main707> ye |
22:04:23 | Yardanico | why 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:38 | Yardanico | idk, your approach might work too, but I don't know a lot about that stuff |
22:04:51 | Yardanico | value types don't say in the GC at all |
22:04:55 | Yardanico | and "ptr" is not managed by the GC |
22:05:20 | Yardanico | well 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:55 | FromDiscord | <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:07 | Yardanico | well check https://github.com/Yardanico/nim-snippets/blob/master/clib/lib.nim? as I said |
22:06:07 | FromDiscord | <Recruit_main707> thanks Yardanico |
22:06:08 | Yardanico | it works just fine |
22:06:17 | Yardanico | newEvaluator returns a ref object |
22:06:27 | Yardanico | then I just GC_ref it and cast to pointer |
22:06:27 | * | lritter quit (Quit: Leaving) |
22:06:36 | FromDiscord | <Recruit_main707> yeah, i have had a look at it several times, its a really good example |
22:07:00 | Yardanico | if you make your bot a ref type it should work in your case too I guess |
22:07:15 | disruptek | so many questions... |
22:07:44 | disruptek | use a value type, write a destructor, pass it as `addr bot`. |
22:07:47 | disruptek | done. |
22:08:07 | Yardanico | disruptek: but how will Nim know that it's not destroyed yet? |
22:08:15 | Yardanico | I mean how will NIm know that it can't destroy it* |
22:08:27 | disruptek | why would you want to destroy it? |
22:08:44 | Yardanico | the destructor will be called in the end of the proc scope |
22:08:50 | Yardanico | unless you use GC_ref |
22:08:57 | disruptek | are you /trying/ to destroy it? |
22:09:09 | Yardanico | disruptek: ??? |
22:09:12 | disruptek | put your bot somewhere where it won't get destroyed? |
22:10:37 | FromDiscord | <Recruit_main707> i think you are both confusing eachother more and more :P |
22:10:49 | Yardanico | i'm going to sleep now anyway :P |
22:11:01 | FromDiscord | <Recruit_main707> me too, gn |
22:56:23 | PMunch | Hmm, god damn it.. I've been trying to fix a bug in my keepass script for ages now |
22:56:43 | PMunch | Turns out it works when compiled with devel, but not with release.. |
22:57:34 | FromDiscord | <Rika> so what was broken |
22:58:22 | PMunch | No idea |
22:58:39 | PMunch | But it's this code: https://github.com/PMunch/libkeepass/blob/master/src/libkeepass.nim |
22:59:19 | PMunch | It 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:37 | PMunch | Hmm, 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 |