00:17:18 | dadada | hmm, how do I get a type's string representation at runtime? foo.type.repr doesn't work here |
00:18:24 | FromGitter | <timotheecour> $typeof(1) |
00:18:35 | FromGitter | <timotheecour> Eg: $int |
00:19:14 | * | Hideki_ quit (Ping timeout: 240 seconds) |
00:20:11 | skrylar[m] | i seem to remember there is some bother depending on if you want the fqn or just the local name |
00:20:59 | * | konvertex quit (Ping timeout: 260 seconds) |
00:22:01 | FromGitter | <timotheecour> see `proc typeToString*(t: typedesc, prefer = "preferTypeName"): string {.magic: "TypeTrait”.}` in tests/metatype/ttypetraits.nim ; I’ll eventually add it to typetraits.nim |
00:38:20 | * | krux02 quit (Remote host closed the connection) |
00:39:57 | * | Tlongir joined #nim |
00:46:25 | FromDiscord | <exelotl> Finally getting the hang of jester, its nice :) |
00:47:51 | FromDiscord | <exelotl> Is there an easy way to do csrf tokens though? Seems pretty important |
00:50:37 | * | lritter quit (Ping timeout: 264 seconds) |
00:50:57 | * | lritter joined #nim |
00:53:46 | FromGitter | <gogolxdong> where FileCoin executes Proof of Replication https://github.com/filecoin-project/bellman/blob/master/src/groth16/verifier.rs |
00:53:52 | skrylar[m] | jester is neat yea |
01:06:35 | * | monok quit (Remote host closed the connection) |
01:08:13 | * | ryan_ joined #nim |
01:10:55 | * | Tlongir quit (Ping timeout: 260 seconds) |
01:17:33 | * | lritter quit (Remote host closed the connection) |
01:22:18 | * | dddddd quit (Ping timeout: 256 seconds) |
01:29:40 | * | ryan_ is now known as dronger |
01:32:59 | * | matthias[m]1 joined #nim |
01:37:11 | * | ptdel joined #nim |
01:39:14 | * | dadada quit (Ping timeout: 260 seconds) |
01:39:57 | * | chemist69 quit (Ping timeout: 252 seconds) |
01:41:55 | * | chemist69 joined #nim |
01:43:57 | FromDiscord | <Technisha Circuit> Is there a way to use Html directly in Nim? (Don't ask why) |
01:46:25 | disruptek | source code filters. |
01:46:35 | disruptek | also, there's an html dsl module iirc. |
01:47:10 | leorize | karax is one such dsl |
01:49:02 | FromGitter | <sealmove> 1) https://hookrace.net/blog/introduction-to-metaprogramming-in-nim/#html-dsl ⏎ 2) https://github.com/juancarlospaco/nim-html-dsl ⏎ 3) https://github.com/pragmagic/karax#hello-world |
01:49:21 | FromGitter | <sealmove> Guys, are object variants the closest Nim has to unions? |
01:49:43 | * | dadada joined #nim |
01:49:54 | FromGitter | <sealmove> I want to change the discriminator at runtime. Is there a better solution than deallocating the object and allocating a new one? |
01:50:06 | * | dadada is now known as Guest9003 |
01:52:48 | leorize | you shouldn't have to deallocate |
01:53:13 | FromGitter | <sealmove> For example: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eb8b009f0377f16317d9f55] |
01:53:13 | leorize | back in the day `reset` would work but it's too dangerous |
01:54:00 | leorize | you can keep the memory if you get only the object part out of it :P |
01:54:18 | disruptek | nuts, imo. |
01:54:20 | leorize | there's some template to dereference a typedesc[ref T] -> typedesc[T] iirc |
01:58:21 | FromGitter | <sealmove> I didn't follow :P |
01:59:08 | Prestige | How do I convert a cstring to a string? |
01:59:33 | * | poohman_1 joined #nim |
02:00:41 | leorize | Prestige: `$`, if you have cstring and a size you'd need to do manual index-by-index copying |
02:01:39 | Prestige | it looks like $ just does the trick, do I still need to do the latter? |
02:01:59 | leorize | sealmove: so if you can get only the object part of it (the part without ref), you can do something like this: node[] = (HuffmanNode[])(isLeaf: true) |
02:02:08 | leorize | which will just rewrite the memory instead of reallocating it |
02:02:18 | Prestige | for context it's just an xlib function returning a cstring |
02:02:34 | leorize | Prestige: if it gives you a size, then you should do the latter |
02:02:43 | Prestige | Thanks |
02:04:15 | FromGitter | <sealmove> Hmm, so I keep the same reference but change the underlying object with an assignment? Looks weird. |
02:06:56 | FromGitter | <sealmove> If I do want to reallocate, does it make sense to do `node = nil` for the ARC to work? |
02:07:00 | FromDiscord | <Varriount> Wasn't there a recent PR that allowed changing the discriminator? |
02:08:21 | leorize | on ly on arc |
02:08:24 | leorize | only* |
02:08:38 | leorize | sealmove: nah, you can just replace the reference |
02:11:43 | * | exelotl quit (Ping timeout: 260 seconds) |
02:13:16 | * | Guest9003 quit (Ping timeout: 246 seconds) |
02:14:57 | disruptek | i really hate van morrison. |
02:16:37 | * | muffindrake quit (Ping timeout: 252 seconds) |
02:17:59 | FromDiscord | <Rika> why |
02:18:49 | * | muffindrake joined #nim |
02:19:49 | * | dadada joined #nim |
02:20:13 | * | dadada is now known as Guest23650 |
02:22:15 | * | avatarfighter joined #nim |
02:22:35 | disruptek | i'm pretty sure it's his music. |
02:22:43 | FromGitter | <sealmove> haha |
02:22:58 | skrylar[m] | i think you can just use `.string` on a cstring and it will do the conversion for you too |
02:23:12 | disruptek | $cstring |
02:31:32 | * | avatarfighter quit (Ping timeout: 260 seconds) |
02:33:34 | skrylar[m] | hmmh. looking at siphash for no real reason other than wireguard is using it |
02:35:17 | skrylar[m] | probably dont need it yet |
02:37:36 | * | minnr joined #nim |
02:41:11 | minnr | Hi all, I was wondering if there was a way to get the nightly version of nim on Windows using scoop, or if choosenim is the best option. |
02:42:36 | skrylar[m] | choosenim is usually what you will be told to use :) |
02:43:54 | * | Guest23650 quit (Ping timeout: 256 seconds) |
02:45:44 | minnr | Thanks, I'll use that instead of scoop. Also, I'm very new to nim and I saw that putting your top-level code in a main procedure, and then calling main(), is best for optimization. Is that still the case? |
02:46:10 | leorize | it's still the case |
02:46:58 | minnr | Great, thanks for your help! |
02:49:00 | FromDiscord | <Rika> is there a reason it's more optimized? |
02:49:51 | * | dadada__ joined #nim |
02:51:06 | leorize | top-level code are basically globals |
02:51:23 | leorize | and globals don't optimize well |
02:51:46 | leorize | eventually we will make it work great, but for now it's not a priority |
02:52:09 | FromGitter | <Willyboar> May i ask something tricky? Let's say i have a proc w/ multiple echos and i want to call it without echos. How can i mute it? |
02:52:26 | leorize | don't use echos :P |
02:52:34 | FromGitter | <Willyboar> Hahahaha |
02:53:08 | leorize | you can easily wrap echo in a wrapper that will only be activated if a magical boolean is true for example |
02:53:35 | FromGitter | <Willyboar> ok i will create the same without echos |
02:54:48 | * | minnr quit (Remote host closed the connection) |
03:04:14 | * | poohman_1 quit (Ping timeout: 240 seconds) |
03:05:05 | * | poohman_1 joined #nim |
03:08:26 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:12:45 | * | avatarfighter joined #nim |
03:13:07 | * | dadada__ quit (Ping timeout: 246 seconds) |
03:13:53 | FromGitter | <sealmove> aaa I am trying to do trees in Nim but I am confused about assignment (shallow vs deep copy). |
03:14:13 | FromGitter | <sealmove> I have all my nodes saved in a plain array (`array[1024, Node]`) |
03:14:33 | FromGitter | <sealmove> I am sure there are exactly 1024 nodes and no more will be added or removed |
03:15:24 | FromGitter | <sealmove> what exactly does something like `myNodeRef.leftChild = nodes[i]` do? |
03:15:52 | disruptek | if nodes[] holds refs, it copies the ref. else it copies the value. |
03:16:12 | * | thomasross quit (Ping timeout: 272 seconds) |
03:16:37 | FromGitter | <sealmove> when you put it like this it sounds simple :P |
03:16:51 | disruptek | i try. |
03:19:46 | * | dadada joined #nim |
03:20:09 | * | dadada is now known as Guest62959 |
03:22:10 | FromGitter | <sealmove> So when the type is defined like `type T = ref object` then `T()` and `new(T)` do the same thing? |
03:22:39 | disruptek | sure. |
03:27:55 | * | avatarfighter quit (Remote host closed the connection) |
03:28:07 | * | avatarfighter joined #nim |
03:31:02 | * | ptdel quit (Remote host closed the connection) |
03:32:18 | * | ptdel joined #nim |
03:35:47 | * | fredrikhr quit (Quit: Client Disconnecting) |
03:39:45 | * | avatarfighter quit (Remote host closed the connection) |
03:40:02 | * | avatarfighter joined #nim |
03:44:29 | * | nekits quit (Quit: The Lounge - https://thelounge.chat) |
03:46:06 | * | nekits joined #nim |
04:02:10 | * | Senketsu joined #nim |
04:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:41 | * | supakeen joined #nim |
04:15:26 | * | rockcavera quit (Remote host closed the connection) |
04:18:55 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
04:19:22 | * | Senketsu_ joined #nim |
04:19:49 | FromDiscord | <Rika> https://github.com/de-odex/suru made a pretty meh progress bar library lol |
04:20:10 | * | Senketsu_ is now known as Senny |
04:30:07 | * | nsf joined #nim |
04:30:26 | FromDiscord | <Yardanico> @Rika nice all rights reserved code xd |
04:30:50 | FromDiscord | <Rika> i didnt put the license, but its in the nimble file |
04:31:01 | leorize | it doesn't count :P |
04:31:08 | FromDiscord | <Rika> i *will |
04:31:15 | FromDiscord | <Rika> i didnt but i will later |
04:31:28 | leorize | to be fair you gotta put the license as a header for all files |
04:31:41 | leorize | though I gotta say that not many people actually care about that |
04:32:02 | FromDiscord | <Yardanico> Do you need to put it in the header though really? |
04:32:09 | FromDiscord | <Anuke> do you *really* have to? |
04:33:05 | leorize | depends on the jurisdiction |
04:33:16 | leorize | usually it's safer to have it (or reference to it) as a header |
04:33:16 | FromDiscord | <Anuke> I mean, if the author adds a license to their repository, that should be a sign that they should be okay with you using any source file in that repository under those terms |
04:34:03 | leorize | legal people don't care about "signs" :P |
04:34:11 | leorize | but INAL so don't quote me on that :P |
04:34:27 | * | Senny quit (Quit: WeeChat 2.8) |
04:34:49 | FromDiscord | <Rika> @Anuke licenses are per-file and per-author |
04:35:07 | FromDiscord | <Rika> so if the author says that a license differs on their work, then it differs for that file only |
04:35:15 | FromDiscord | <Rika> that -> their |
04:35:30 | leorize | not all licenses are per-file |
04:35:53 | FromDiscord | <Anuke> so if someone puts a `LICENSE` in their repo and doesn't add any headers to their files, they can theoretically sue you for using their code in accordance with that license? |
04:35:54 | leorize | GPL for example, applies to the entire "software" |
04:36:22 | leorize | depends on the license wording afaik |
04:36:28 | leorize | usually you should ask a lawyer :P |
04:37:24 | * | Senketsu quit (Ping timeout: 244 seconds) |
04:38:30 | FromDiscord | <Rika> not a new project w/o yardanico complaining about the license on it i guess |
04:38:30 | shashlick | Does Nim not flash stdout on asserts? |
04:38:35 | shashlick | Flush |
04:38:40 | FromDiscord | <Rika> why would it? |
04:38:49 | * | Senketsu joined #nim |
04:39:41 | shashlick | Done debugging could be printed out |
04:40:45 | leorize | ? |
04:44:17 | * | exelotl joined #nim |
04:44:25 | FromGitter | <kaushalmodi> Rika: can you also put a gif of the progress bar in action? |
04:45:02 | FromGitter | <kaushalmodi> 1) in the repo's readme |
04:47:49 | FromDiscord | <Rika> okay ill do that |
04:56:02 | FromDiscord | <Rika> done |
05:04:26 | FromDiscord | <Rika> oh, MIT also uses "software" as a whole and not code, but afaik some people have used it on individual code files |
05:05:24 | leorize | software can be consisted of only one file :P |
05:05:46 | leorize | GPL also uses software as a whole, but they explicitly require that you mark files with the gpl header |
05:06:03 | FromDiscord | <Rika> mm, i see |
05:06:56 | leorize | to be on the safe side, I'd just mark every file (and I have to currently, as my library is MPL-2) |
05:09:14 | * | poohman_1 quit (Ping timeout: 240 seconds) |
05:09:22 | * | poohmaan joined #nim |
05:28:18 | * | narimiran joined #nim |
05:28:48 | skrylar[m] | bleh. i just have a note that its all mpl, but nobody has really bothered for more |
05:29:01 | * | Guest62959 quit (Ping timeout: 264 seconds) |
05:34:56 | * | dadada joined #nim |
05:35:20 | * | dadada is now known as Guest58503 |
05:36:03 | * | poohman_1 joined #nim |
05:39:35 | * | poohmaan quit (Ping timeout: 256 seconds) |
05:53:40 | * | oculux quit (Ping timeout: 256 seconds) |
05:57:36 | * | oculux joined #nim |
05:58:58 | * | Guest58503 quit (Ping timeout: 272 seconds) |
06:04:50 | * | dadada__ joined #nim |
06:07:33 | * | kungtotte quit (Read error: Connection reset by peer) |
06:07:51 | * | kungtotte joined #nim |
06:18:34 | * | ftsf quit (Ping timeout: 240 seconds) |
06:19:43 | * | ftsf joined #nim |
06:23:00 | FromDiscord | <Technisha Circuit> How would i list everything in a directory with Nim? |
06:23:26 | * | filcuc joined #nim |
06:24:45 | FromDiscord | <Technisha Circuit> Similar to os.listdir |
06:25:50 | * | PMunch joined #nim |
06:28:48 | * | dadada__ quit (Ping timeout: 256 seconds) |
06:29:28 | FromDiscord | <Never Listen To Beef> walk dir |
06:30:18 | FromDiscord | <Technisha Circuit> How do i use it? Also how would i use a python decorator in Nim? |
06:30:28 | FromDiscord | <Technisha Circuit> Using Nimpy |
06:31:18 | FromDiscord | <Never Listen To Beef> Seems you'd walkdir, then check if each item is a directory and walk that one |
06:31:50 | * | poohman joined #nim |
06:32:10 | * | filcuc quit (Quit: Konversation terminated!) |
06:33:02 | FromDiscord | <Never Listen To Beef> Ah there is walkdirRec |
06:33:14 | FromDiscord | <Technisha Circuit> Thanks |
06:33:37 | FromDiscord | <Technisha Circuit> > Also how would i use a python decorator in Nim? |
06:33:37 | FromDiscord | <Technisha Circuit> Also ^^ |
06:34:11 | FromDiscord | <Never Listen To Beef> Idk what that even means |
06:34:19 | FromDiscord | <Technisha Circuit> Okay then :P |
06:34:28 | * | poohman_1 quit (Ping timeout: 256 seconds) |
06:34:50 | * | dadada joined #nim |
06:35:14 | * | dadada is now known as Guest96426 |
06:35:34 | * | sz0 joined #nim |
06:39:15 | Yardanico | Found about https://github.com/hediet/vscode-debug-visualizer/ |
06:39:22 | Yardanico | trying to make a smol nim demo |
06:39:42 | Yardanico | basically how it works is you need to create something in your program which will return a JSON string for the data you want to visualize |
06:39:53 | Yardanico | and then you'll be able to see it visualized when debugging |
06:41:28 | FromDiscord | <Technisha Circuit> I don't like that Nim doesn't keep stuff in the module namespace most of the time ;-; |
06:41:36 | Yardanico | ?? |
06:41:38 | FromDiscord | <Technisha Circuit> But it's manageable |
06:42:46 | FromDiscord | <Technisha Circuit> Like, if i imported `nimpy`, there's pyBuiltinsModule but I'd want it so instead of me just being able to do `pyBuiltinsModule()`, I'd want it to be like `nimpy.pyBuiltinsModule()` |
06:43:02 | Yardanico | "from nimpy import nil" |
06:43:09 | Yardanico | and you'll have to fully qualify all stuff |
06:43:41 | Yardanico | https://nim-lang.org/docs/manual.html#modules-from-import-statement |
06:44:31 | * | dddddd joined #nim |
06:45:27 | FromDiscord | <Technisha Circuit> Oh nice, thanks! |
06:48:17 | FromDiscord | <Technisha Circuit> Also, do you know how I'd use a decorator from a python lib in Nim? |
06:48:22 | Yardanico | no |
06:48:45 | FromDiscord | <Technisha Circuit> Damn |
06:49:05 | Yardanico | I don't use nimpy really |
06:49:58 | FromDiscord | <Never Listen To Beef> The real trick isnt using python 😄 |
06:50:46 | FromDiscord | <Technisha Circuit> Haha |
06:51:01 | FromDiscord | <Technisha Circuit> I just like doing stupid stuff, what can i say ¯\\_(ツ)\_/¯ |
06:51:53 | FromDiscord | <Rika> just found incorrect behavior on suru... |
06:52:44 | * | waleee-cl joined #nim |
06:53:25 | FromGitter | <bung87> is there KV database write in nim? |
06:53:49 | * | solitudesf joined #nim |
06:54:06 | Yardanico | i saw some |
06:54:08 | FromDiscord | <Never Listen To Beef> This is where i jokingly say "we have tables" |
06:55:30 | FromGitter | <bung87> no tables is not "database" |
06:56:05 | FromDiscord | <Rika> wasnt there a redis client in nim? |
06:56:41 | FromGitter | <bung87> I know that, I am not intend to just "use" |
06:57:20 | FromDiscord | <Never Listen To Beef> I've never seen poes law happen when someone explcitly states that they're joking |
06:58:31 | * | Guest96426 quit (Ping timeout: 246 seconds) |
07:01:40 | Yardanico | I DID IT |
07:01:43 | Yardanico | I ACTUALLY DID IT LOL |
07:02:01 | FromGitter | <bung87> I googled https://nikhilism.com/post/2016/writing-simple-database-in-rust-part-1/ just wonder how to implement it in Nim |
07:02:01 | FromDiscord | <Never Listen To Beef> Nope you didnt ban me |
07:02:03 | Yardanico | https://i.imgur.com/AsDrFu9.png |
07:02:20 | Yardanico | and yes as I step in the debugger new values are being added |
07:02:41 | Yardanico | god bless lldb |
07:02:45 | Yardanico | type format add --format c-string NCSTRING |
07:03:12 | Yardanico | this extension supports arrays (can have multiple rows) and graphs |
07:03:26 | FromDiscord | <Technisha Circuit> What's a good web library similar to Flask for Nim? |
07:03:36 | Yardanico | jester is quite minimal, there's prologue though |
07:03:45 | Yardanico | I didn't try prologue yet, but afaik it has more features |
07:03:48 | Yardanico | like middleware and stuff |
07:04:09 | FromDiscord | <Technisha Circuit> Thanks! |
07:04:25 | * | Romanson joined #nim |
07:04:41 | PMunch | Hmm, how simple is it to use NimScript in an application |
07:04:48 | FromGitter | <bung87> !repo prologue |
07:04:49 | disbot | https://github.com/planety/prologue -- 9prologue: 11Full-Stack Web Framework written in Nim. 15 110⭐ 1🍴 7& 1 more... |
07:04:56 | * | dadada__ joined #nim |
07:05:07 | PMunch | And if you built it into a binary distribution, you'll still have to ship the Nim stdlib right? |
07:05:30 | PMunch | Or can the stdlib somehow be be built into the binary? |
07:06:12 | PMunch | Oh, and how feasable would it be to have a nimscript.(so|dylib|dll)? |
07:07:46 | FromDiscord | <Never Listen To Beef> There is https://github.com/Serenitor/embeddedNimScript which forces you to include the compiler |
07:08:41 | FromDiscord | <Technisha Circuit> How would i make prologue use a custom port and address? |
07:08:54 | FromDiscord | <Technisha Circuit> So if i wanted to host on 127.0.0.1, how would i do that |
07:09:16 | Yardanico | read the docs? |
07:09:36 | FromDiscord | <Technisha Circuit> Also `/data/data/com.termux/files/home/.nimble/pkgs/httpbeast-0.2.2/httpbeast.nim(282, 17) Error: undeclared identifier: 'addTimer'` |
07:09:39 | FromDiscord | <Technisha Circuit> Okay :P |
07:10:10 | * | Vladar joined #nim |
07:10:11 | Yardanico | and check examples like https://github.com/planety/prologue/tree/master/examples/todolist |
07:10:17 | FromDiscord | <Technisha Circuit> Thanks :P |
07:10:30 | Yardanico | now lemme try visualizing bubble sort |
07:10:53 | skrylar[m] | hah it has the little crowns in the tabs |
07:11:30 | PMunch | @Never Listen To Beef, yeah I found that yesterday. Seems interesting, but a bit too opinionated |
07:11:47 | PMunch | How does nimble do this? |
07:11:48 | FromGitter | <bung87> or just ask the author @xflywind |
07:12:13 | FromDiscord | <Never Listen To Beef> It also lacks quite a bit imo |
07:12:37 | FromDiscord | <Never Listen To Beef> Not being able to call procs and the like is quite annoying |
07:13:12 | FromDiscord | <Technisha Circuit> Where is addTimer imported from? |
07:13:38 | * | BarbaraPalv joined #nim |
07:13:58 | FromGitter | <bung87> I guess https://nim-lang.org/docs/asyncdispatch.html#addTimer%2Cint%2Cbool%2CCallback |
07:14:10 | FromDiscord | <Varriount> skrylars: What are you referencing? |
07:14:24 | PMunch | Ah.. Nimble seem to just call "nim e".. |
07:14:39 | Yardanico | haha it works |
07:15:17 | * | liblq-dev joined #nim |
07:15:48 | * | BarbaraPalv quit (Client Quit) |
07:18:20 | Araq | I'm back |
07:18:23 | Araq | too 4 days off |
07:18:26 | Araq | *took |
07:18:32 | Yardanico | welcome back :P |
07:18:37 | FromDiscord | <Rika> welcome back |
07:18:40 | PMunch | Welcome back |
07:18:50 | PMunch | Good to take some time off once in a while |
07:19:32 | FromDiscord | <Never Listen To Beef> That's why no one was answering my silly questions like how to add two ints in nim |
07:20:03 | liblq-dev | welcome back |
07:21:16 | FromDiscord | <Never Listen To Beef> So lib i moved over to the proper vertex method, 1 big array of floats now |
07:21:20 | FromDiscord | <Rika> @Never Listen To Beef of course its just a simple system.\`+`(int1.int, int2.int) and totally not just int1 + int2 |
07:21:43 | FromDiscord | <Never Listen To Beef> Ah yes that's what i was doing wrong, thanks! |
07:24:05 | FromDiscord | <Never Listen To Beef> @Rika Look what you encouraged |
07:24:05 | FromDiscord | <Never Listen To Beef> https://play.nim-lang.org/#ix=2lCr |
07:25:46 | FromDiscord | <Never Listen To Beef> I wonder if reading stuff like that makes him regret creating nim |
07:27:19 | Yardanico | I managed to add markers, lemme show a video, it's actually pretty cool |
07:28:11 | skrylar[m] | wb araq |
07:28:19 | skrylar[m] | Varriount: yards vscode screenshot |
07:28:46 | * | dadada__ quit (Ping timeout: 260 seconds) |
07:28:52 | Yardanico | skrylar[m]: I made it even better, lemme show |
07:29:07 | FromGitter | <gogolxdong> Is there a rust2nim library? |
07:29:07 | FromDiscord | <Rika> @Never Listen To Beef https://play.nim-lang.org/#ix=2lCt |
07:29:29 | FromDiscord | <Never Listen To Beef> Yea i realized after sending i could've done that |
07:29:41 | Yardanico | C# be like |
07:29:45 | Yardanico | sorry java |
07:30:02 | Yardanico | isn't this kinda cool? :P https://www.youtube.com/watch?v=QXneLboQMB0 |
07:30:03 | Yardanico | skrylar[m]: ^ |
07:30:45 | Yardanico | I'm using lldb with https://github.com/hediet/vscode-debug-visualizer |
07:30:56 | FromDiscord | <Rika> me a dumbo, how do you use debugger in vscode for nim |
07:30:58 | Yardanico | that extension is language-agnostic since the only thing it needs is json |
07:31:02 | Yardanico | @Rika gdb/lldb |
07:31:03 | skrylar[m] | its pretty fancy |
07:31:14 | Yardanico | there's nim-gdb for some pretty-printing for nim |
07:31:51 | Yardanico | full src - https://play.nim-lang.org/#ix=2lCu |
07:31:56 | skrylar[m] | i do something kind of like that with dumping dot graphs but something nicer would be good |
07:31:56 | Yardanico | and yes I use sugar.collect because I'm lazy |
07:31:58 | FromDiscord | <Rika> how do i set it up for vscode, i know how its set up normally |
07:32:03 | Yardanico | the same way |
07:32:19 | Yardanico | for lldb I literally have https://play.nim-lang.org/#ix=2lCv |
07:32:29 | Yardanico | using https://github.com/vadimcn/vscode-lldb |
07:33:09 | Yardanico | and of course compile with --debugger:native |
07:34:04 | FromDiscord | <Technisha Circuit> How do i read a file in Nim? |
07:34:11 | Yardanico | go read docs pls |
07:34:19 | Yardanico | https://nim-lang.org/docs/io.html |
07:34:26 | FromDiscord | <Technisha Circuit> Thanks :P |
07:34:43 | * | dadada joined #nim |
07:35:06 | * | dadada is now known as Guest17205 |
07:36:42 | FromDiscord | <Rika> bruh xd |
07:46:16 | skrylar[m] | i spent a couple hours putting kanboard on a raspberry before learning that was a dumb idea |
07:46:25 | skrylar[m] | raspberries are slow web servers xD |
07:47:44 | FromDiscord | <Technisha Circuit> Exception handling is exactly the same as Python and i love it |
07:47:56 | skrylar[m] | for now yea |
07:48:01 | Yardanico | skrylar[m]: it's already different |
07:48:04 | Yardanico | --panics:on exists :P |
07:48:06 | Yardanico | and we have defects |
07:48:30 | skrylar[m] | eh. i still prefer exceptions |
07:49:18 | FromDiscord | <Technisha Circuit> How many spaces are preferred for an indent? |
07:49:24 | FromDiscord | <Rika> 2 |
07:49:38 | Yardanico | yeah, 2 |
07:49:50 | skrylar[m] | am partial to 3 becuse reasons |
07:53:44 | FromDiscord | <Technisha Circuit> Thanks |
07:57:52 | Yardanico | so I finished creating the Nim demo, will probably PR it to https://github.com/hediet/vscode-debug-visualizer |
07:58:32 | skrylar[m] | there were some old (and i don't have them anymore) discussions on this from other communities, and it was basically that linus uses 8 because he thinks if you are nesting too much you are already screwed and the large spacing encourages you not to do it, 4 is more or less a global default (kakoune gives you 4, many many many standards are 4.) i always liked the way 3 looked but its the least common. |
07:58:34 | FromDiscord | <demotomohiro> Project website link in this page seems wrong. |
07:58:34 | FromDiscord | <demotomohiro> https://nimble.directory/pkg/nimterop |
07:58:34 | FromDiscord | <demotomohiro> I think it should link to |
07:58:34 | FromDiscord | <demotomohiro> https://github.com/nimterop/nimterop |
07:58:54 | * | Guest17205 quit (Ping timeout: 256 seconds) |
08:02:38 | liblq-dev | what would be a good idea for efficient GL uniform storage? I want to allow the user to still use regular tables, but at the same time, I want to have a more efficient representation |
08:02:57 | liblq-dev | I was thinking about iterators, but then you can't really pass an iterator as an argument to a proc |
08:03:01 | liblq-dev | unless it's a closure iterator |
08:04:17 | liblq-dev | but I'm worried that the overhead of a closure iterator would be pretty high, I'd like to keep it to a minimum |
08:04:55 | * | dadada__ joined #nim |
08:06:20 | Yardanico | https://github.com/hediet/vscode-debug-visualizer/pull/51 |
08:06:20 | disbot | ➥ Add Nim demo |
08:06:48 | FromGitter | <bung87> why not just using ` closure iterator`? |
08:07:03 | Yardanico | "overhead" |
08:07:06 | liblq-dev | @bung87, I'm not sure about the overhead |
08:07:09 | skrylar[m] | you get an alloc every time you use a closure |
08:07:11 | liblq-dev | idk how high it is |
08:07:33 | * | lmariscal9 joined #nim |
08:07:45 | liblq-dev | hmm |
08:07:51 | skrylar[m] | i'm not sure what you mean by efficient uniform storage and regular tables. opengl doesn't use tables? |
08:08:02 | * | Vladar quit (Quit: Leaving) |
08:08:15 | liblq-dev | it probably uses a regular array internally |
08:08:16 | FromGitter | <bung87> hmm I never thought of it, as it is a language feature.. |
08:08:30 | Yardanico | @bung87 well you know, language features can have a cost too |
08:08:35 | liblq-dev | by efficient I mean, I regenerate them every frame and the overhead is low |
08:08:36 | Yardanico | and it applies to all languages out there |
08:08:47 | liblq-dev | ie. it's fast |
08:08:49 | * | kitech1- joined #nim |
08:08:50 | Yardanico | it's just that in languages like python most people don't care :D |
08:09:08 | skrylar[m] | uniforms can be literally anything :shrug: |
08:09:22 | skrylar[m] | view matrix? skeleton parameters? |
08:09:41 | Yardanico | https://github.com/halonium/halonium cool stuff |
08:09:58 | liblq-dev | guess I'll try closure iterators, we'll see how it goes |
08:10:09 | FromGitter | <bung87> yeah that's right, as it just a keyword, what else approach definately more than a word.. |
08:10:26 | Yardanico | closure is a pragma first of all |
08:10:46 | FromDiscord | <demotomohiro> I think cost of closure iterator is small compared to cost of creating copy of state of GL unform in memory. |
08:10:54 | * | deepend_ joined #nim |
08:11:23 | skrylar[m] | its an alloc every frame, which is the kind of overhead you usually avoid |
08:12:38 | skrylar[m] | there was a talk about this the other day in this channel because someone was asking if they could store the closure on the stack instead and they were told no |
08:12:56 | FromDiscord | <Recruit_main707> halonium is the cooler requests?? |
08:13:15 | FromDiscord | <Recruit_main707> it looks so cool |
08:14:00 | Yardanico | it's for browser automation |
08:14:05 | Yardanico | like selenium |
08:14:19 | FromGitter | <bung87> it alloc memory for `closure iterator` its self? |
08:14:45 | * | vqrs_ joined #nim |
08:15:30 | liblq-dev | it allocates memory for the closure. every. single. frame. |
08:15:33 | FromGitter | <bung87> like a variable declaration for every time it calls? |
08:15:37 | liblq-dev | worse |
08:15:48 | liblq-dev | because variable decl are done on the stack which is faster to access |
08:15:52 | * | vqrs quit (*.net *.split) |
08:15:53 | * | kitech1 quit (*.net *.split) |
08:15:53 | * | lmariscal quit (*.net *.split) |
08:15:53 | * | deepend quit (*.net *.split) |
08:15:53 | * | cornfeedhobo quit (*.net *.split) |
08:15:54 | * | lmariscal9 is now known as lmariscal |
08:15:54 | liblq-dev | closures are allocated on the heap |
08:16:28 | * | cornfeedhobo joined #nim |
08:16:44 | liblq-dev | but idk if there's a better solution, everything else seems to involve an alloc too |
08:17:10 | FromGitter | <bung87> I think I get the point , no-closure just get the proc pointer right? |
08:21:59 | skrylar[m] | wouldn't you just store the uniform on the heap or inside an object somewhere, modify it each frame and then upload from the same buffer each time? |
08:24:44 | liblq-dev | hmm |
08:27:16 | FromDiscord | <demotomohiro> ``proc getUniform[T](progObj: GLuint; uniformName: string): T =`` |
08:27:38 | liblq-dev | no, I don't want to *get* the uniforms |
08:27:40 | liblq-dev | I want to set them |
08:28:14 | * | dadada__ quit (Ping timeout: 240 seconds) |
08:28:41 | Yardanico | merged https://github.com/hediet/vscode-debug-visualizer/pull/51 |
08:28:41 | disbot | ➥ Add Nim demo |
08:30:30 | FromDiscord | <demotomohiro> ``proc setUniform[T](progObj: GLuint; uniformName: string; val: T) =`` |
08:31:01 | FromDiscord | <demotomohiro> is not good? |
08:31:17 | FromDiscord | <Recruit_main707> Yardanico good stuff |
08:31:55 | skrylar[m] | demotomohiro: you would look up the index for where the uniform goes once and reuse it, not use the string lookup there each time |
08:33:09 | skrylar[m] | then some version of `glUniform` to actually upload |
08:34:52 | * | dadada joined #nim |
08:35:16 | * | dadada is now known as Guest26999 |
08:38:22 | * | krux02 joined #nim |
08:40:11 | * | xet7_ joined #nim |
08:43:14 | * | xet7 quit (Ping timeout: 240 seconds) |
08:45:38 | FromGitter | <sealmove> #@%^ yeah! I finally did it! :) decompression works: https://github.com/sealmove/LZ77 |
08:46:16 | FromGitter | <sealmove> (no idea why the fonts look so bit in gitter) |
08:46:20 | FromDiscord | <Never Listen To Beef> Now if you never compressed in the first place you wouldnt have said the last sentence 😛 |
08:46:42 | FromGitter | <sealmove> I didn't. Microsoft did :P |
08:47:20 | * | xet7_ is now known as xet7 |
08:47:29 | * | xet7 quit (Quit: Leaving) |
08:47:58 | * | xet7 joined #nim |
08:48:38 | FromGitter | <sealmove> Wow! I spent 5 days on 150 lines of code |
08:48:57 | FromDiscord | <Never Listen To Beef> How writting shaders feels |
08:51:48 | skrylar[m] | some lines of code are more important than others |
08:52:27 | Yardanico | like nim's tlsf-based allocator |
08:52:32 | Yardanico | 1k lines, but really important :P |
08:52:32 | FromGitter | <sealmove> This is the secord open-source implementation of this decompression algorithm. The only other one that I know is this: https://github.com/libyal/libfwnt/ but well... it's C, a lot messier than 166 lines :) |
08:52:57 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/lib/system/alloc.nim |
08:53:21 | skrylar[m] | Yardanico: isn't that going kaput with arc/newruntime |
08:53:24 | Yardanico | no? |
08:53:32 | Yardanico | the allocator is not related to the GC really |
08:53:40 | Yardanico | and nim's allocator is really great |
08:53:49 | skrylar[m] | it says it implies --useMalloc |
08:54:07 | Yardanico | arc doesn't imply -d:useMalloc |
08:54:18 | Yardanico | actually arc with -d:useMalloc is much slower than without it |
08:54:25 | Yardanico | it's only for debugging |
08:54:31 | Yardanico | or porting to new OSes |
08:54:32 | Zevv | no it doesn't. But it is easier to debug with -d:useMalloc |
08:54:32 | Zevv | right |
08:54:58 | Yardanico | --os:any -d:useMalloc and you can use nim on any platform which has a C compiler and standard C library ported |
08:55:03 | Zevv | especially when doing valgrind for example. It makes one Nim alloc match one libc alloc |
08:55:07 | Yardanico | at least simplest parts of it |
08:55:22 | Yardanico | Zevv: yeah, but even for simple programs -d:useMalloc can result in 22k allocs for example :P |
08:55:40 | Yardanico | and without it there's only 1 allocation |
08:55:43 | Zevv | sure. |
08:55:48 | skrylar[m] | --newruntime use an alternative runtime that uses destructors and that uses a shared heap via -d:useMalloc [https://nim-lang.org/docs/nimc.html] :E |
08:55:58 | Yardanico | arc is not newruntime |
08:56:03 | Yardanico | they're different |
08:56:09 | Zevv | it's a mess, right :) |
08:56:17 | Yardanico | well they are similar in some ways but they're not the same |
08:56:22 | Zevv | first some of the undead corpses have to be properly killed and buried |
08:57:37 | FromGitter | <bung87> @sealmove I guess most time costs in reading... |
09:00:00 | planetis[m] | sealmove: nice |
09:00:16 | planetis[m] | Yardanico thanks i will fix it |
09:03:06 | * | sz0 quit (Quit: Connection closed for inactivity) |
09:03:33 | FromGitter | <sealmove> Yes, my mistake was that I started writing code before reading the specs 10 times |
09:04:01 | skrylar[m] | ouch. did that for cassowary. spent a month trying to figure that out |
09:04:45 | FromGitter | <sealmove> cassowary? |
09:05:05 | skrylar[m] | linear constraint engine for guis |
09:08:26 | Araq | Yardanico, er the allocations are there either way |
09:08:43 | Araq | with our allocator they are simply not counted properly by some tools |
09:08:49 | Yardanico | ah okay |
09:08:59 | Araq | but yeah, our alloator is awesome tech |
09:09:15 | Araq | it sucks for multi-threading though, uses a single lock |
09:09:46 | Araq | that said, that can be an advantage for hard realtime systems because nobody understands hard realtime :P |
09:10:51 | Araq | or to put it differently: a (fair!) lock around an O(1) operation keeps the O(1) |
09:11:38 | Araq | when the number of threads is bounded. |
09:22:03 | planetis[m] | is it just me or nim devel is broken with --gc:arc? |
09:22:47 | planetis[m] | no its me |
09:23:27 | Yardanico | planetis[m]: it depends on what you're trying to compile with arc :P |
09:24:12 | planetis[m] | no I was trying to make a new branch to change that "use move" message in injectdestructors |
09:24:55 | planetis[m] | what should it say though? should i just remove it? |
09:24:59 | Yardanico | ? |
09:25:06 | Yardanico | who? |
09:26:23 | FromDiscord | <Never Listen To Beef> When? |
09:26:28 | Yardanico | why? |
09:26:34 | FromDiscord | <Never Listen To Beef> How? |
09:26:37 | Yardanico | btw https://github.com/kostya/benchmarks/pull/252/files |
09:26:38 | disbot | ➥ Add packedjson for Nim |
09:26:57 | Yardanico | in matmul benchmark arraymancer is the best there btw |
09:27:10 | Yardanico | beats everything, including julia |
09:28:21 | FromDiscord | <Never Listen To Beef> Packed json makes it mor performant than python then eh? |
09:28:50 | FromDiscord | <Never Listen To Beef> I previously seen that benchmark and was astounded that nim was slower than python and used more memory |
09:29:01 | Yardanico | because json is implemented differently |
09:29:10 | Yardanico | python for me is 2s |
09:29:14 | Yardanico | slower than Nim |
09:29:22 | Yardanico | I mean CPython, not PyPy |
09:29:34 | planetis[m] | "passing '$1' to a sink parameter introduces an implicit copy use 'move($1)' to prevent it" |
09:29:49 | Yardanico | planetis[m]: can you show the code? |
09:29:56 | Yardanico | but it's a hint |
09:30:01 | Yardanico | not even a warning |
09:30:07 | Yardanico | so you don't *have to* to do that :) |
09:30:28 | * | Romanson quit (Quit: Connection closed for inactivity) |
09:30:30 | planetis[m] | yardanico: there was a discussion https://forum.nim-lang.org/t/6309 |
09:30:34 | * | konvertex joined #nim |
09:31:23 | FromDiscord | <Yardanico> You can see I replied there lol |
09:31:36 | planetis[m] | btw that isClosureEnv check at: https://github.com/nim-lang/Nim/blob/devel/compiler/injectdestructors.nim#L397 doesn't work correctly |
09:32:06 | planetis[m] | because in my code i get messages like: Hint: passing ':env.place22' to a sink parameter introduces an implicit copy; use 'move(:env.place22)' |
09:32:06 | FromDiscord | <Yardanico> Fix it :P |
09:32:19 | FromDiscord | <Yardanico> Well it's the same for async |
09:32:34 | FromDiscord | <Yardanico> Try compiling any not small async app with orc |
09:32:38 | FromDiscord | <Yardanico> You'll see pages of these hints |
09:33:00 | planetis[m] | haha |
09:33:10 | FromDiscord | <Yardanico> https://forum.nim-lang.org/t/6309#38907 but read this too |
09:34:39 | planetis[m] | yes so deleting it, is not what we want |
09:35:08 | planetis[m] | thought it would be easy 😂 |
09:39:19 | * | abm joined #nim |
09:39:50 | Araq | almost whenever Python is "faster" than Nim, you're measuring C code Python happens to use |
09:40:50 | Araq | whereas our code is usually handicapped by our requirements for portability, including portability to Nim's VM so everything can work at compile-time |
09:43:00 | Araq | it's annoying. |
09:47:27 | FromGitter | <bung87> that's right, most cases Nim is x faster than Python |
09:47:31 | * | krux02 quit (Remote host closed the connection) |
09:50:29 | Araq | if you want to benchmark language implementations, benchmark language features, not standard libraries. if you instead care about "bugah bugah *in practice*" then at least pick a benchmark that reflects your application domain. |
09:51:03 | Araq | for example, as a compiler writer I don't care about json's performance |
09:51:15 | Araq | nor about matrix multiplications |
09:52:46 | * | natrys joined #nim |
09:55:09 | * | ryan_ joined #nim |
09:57:58 | * | dronger quit (Ping timeout: 256 seconds) |
09:58:46 | * | exelotl quit (Ping timeout: 246 seconds) |
09:59:55 | * | Jim21 joined #nim |
10:00:16 | * | Trustable joined #nim |
10:00:36 | * | Jim21 quit (Remote host closed the connection) |
10:01:48 | FromDiscord | <Rika> but the application domain depends on who's looking, no? |
10:03:27 | Yardanico | ? |
10:04:21 | FromDiscord | <Rika> the application domain to be applied on the benchmarks are not dependent on who is running them, but dependent on who is looking at them, no? |
10:04:27 | skrylar[m] | i thought about tossing that tldf thing in a module for disc files a time or two |
10:04:33 | FromDiscord | <Rika> i have to go, it is late |
10:04:54 | skrylar[m] | its rare but some (mostly database?) formats also alloc space |
10:05:48 | Araq | Rika: well yes. |
10:18:54 | * | exelotl joined #nim |
10:27:12 | * | NimBot joined #nim |
10:31:12 | FromDiscord | <Zed> It's strange how simple nim is |
10:31:17 | FromDiscord | <Zed> well not strange |
10:31:47 | FromDiscord | <Zed> more like, why do i keep coming back to it from other languages |
10:35:05 | FromDiscord | <Zed> i have spent the past week coding in swift but now im re-writing the entire program in nim |
10:35:10 | Yardanico | lel |
10:35:41 | dom96 | You tell us, why do you prefer Nim over Swift? |
10:36:20 | skrylar[m] | zed: because stuff in nim just works. lol |
10:40:55 | * | Trustable quit (Remote host closed the connection) |
10:42:46 | * | Trustable joined #nim |
10:47:36 | FromDiscord | <Zed> @dom96 Swift is great dont get me wrong but somethings are just over complicated eg opening a file, rather then saying openFile() or something you have to make a URL object and then some super long method call just to open up the file |
10:49:14 | FromDiscord | <Zed> it's the little things that add up that i dont like |
10:53:35 | dom96 | I see. Interesting |
10:55:08 | FromDiscord | <Zed> also i love this discord because there's 2 other guys here called zed |
10:56:17 | FromGitter | <sealmove> I agree. Imagine the sensation of liberty compared to being forced to make classes for everything. Nim is really amazing at being simple and complex at the same time :) |
11:01:46 | FromDiscord | <Zed> yup, although i dont actually mind classes and swift doesn't force you to use them |
11:05:46 | * | Guest26999 quit (Ping timeout: 260 seconds) |
11:06:19 | * | fredrikhr joined #nim |
11:06:39 | * | dadada joined #nim |
11:07:03 | * | dadada is now known as Guest15212 |
11:10:07 | FromDiscord | <Yardanico> But do you get method call syntax without classes? :p |
11:11:46 | FromGitter | <sealmove> Even if the language doesn't force you, usually it makes it painful to go the other way |
11:11:53 | FromDiscord | <Zed> I'm not entirely sure what that is |
11:12:39 | FromGitter | <sealmove> @Zed https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax |
11:18:46 | FromDiscord | <Zed> ah so just weird ways of calling the same function lol |
11:19:49 | FromDiscord | <Yardanico> Not really weird xd |
11:24:29 | FromDiscord | <Yardanico> a.b() == b(a) allows for a lot of cool stuff |
11:31:42 | FromGitter | <bung87> that's why I hate js , need rember operation position which is left which is right.. |
11:42:52 | skrylar[m] | sealmove: https://ariya.github.io/FastLZ/ =o |
11:46:26 | FromDiscord | <Zed> how have you guys found the embedded space with nim? |
11:46:40 | FromDiscord | <clyybber> ask Zevv :) |
11:47:08 | Yardanico | well I don't do embedded but it's much better with --os:any and gc:arc |
11:47:11 | Yardanico | which are both relatively new things |
11:48:10 | FromDiscord | <Zed> @clyybber Do you know if he has a github? |
11:48:28 | FromDiscord | <clyybber> sure, https://github.com/zevv/ |
11:48:57 | * | Hideki_ joined #nim |
11:49:14 | FromDiscord | <Zed> thanks!, he didn't show up for me |
11:49:36 | * | Hideki_ quit (Remote host closed the connection) |
11:52:25 | FromGitter | <sealmove> @skrylar oh cool! I definately missed this |
11:53:41 | FromGitter | <sealmove> Honestly the microsoft documentation was very decent and it includes sufficient pseudocode. I am just not used to this type of work. For someone experienced it should be a couple of hours work. |
11:55:59 | FromGitter | <sealmove> Though it does look a bit different from what I implemented. LZ77 is used for a lot of stuff. I think ariya's implementation is focused on other file formats than Windows Prefetch. |
11:58:39 | Araq | I think we need classes in a very mild form, pending an RFC |
11:59:32 | Araq | it would solve some problems and not introduce new ones (famous last words...) |
11:59:40 | FromDiscord | <Yardanico> As a language feature or sugar with macros? |
11:59:56 | Araq | as a language feature, no new syntax required |
12:00:09 | Araq | just some tweaking of today's rules |
12:00:10 | FromGitter | <alehander92> oh no |
12:00:26 | FromGitter | <alehander92> can't it be somehow simulated with current feature |
12:00:28 | FromDiscord | <clyybber> Araq: Maybe simply a parameter annotation to bind the proc to a parameter's type? |
12:00:38 | FromDiscord | <clyybber> alehander92: Its about type bound ops |
12:00:46 | FromDiscord | <clyybber> Not classes at runtime I think |
12:01:08 | Araq | clyybber: I don't have an annotation in mind, but probably people prefer one |
12:01:10 | FromDiscord | <Yardanico> "oh no" is usually used in a joking manner anyway :) |
12:01:41 | Araq | and yeah, this is awesome. before I fleshed out my proposal, be against it. |
12:02:26 | Araq | because Araq is known to destroy Nim's design. :P |
12:03:13 | FromGitter | <alehander92> sorry, it was an actual `oh no` |
12:03:18 | FromGitter | <alehander92> but i shouldnt judge like that |
12:03:24 | FromGitter | <alehander92> ah is it type classes |
12:03:35 | FromGitter | <alehander92> traits* |
12:04:19 | FromGitter | <alehander92> can we get pattern matching into fusion btw :D |
12:04:28 | FromGitter | <alehander92> (when talking about RFC-s) |
12:05:26 | FromDiscord | <Yardanico> Yeah I wonder which kinds of libraries will be accepted into Fusion |
12:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:42 | * | supakeen joined #nim |
12:07:18 | Araq | hmm I think 'fusion' is still misunderstood |
12:07:42 | Araq | alehander92: you need to become a fusion core developer to get your pattern matching into 'fusion' |
12:08:21 | FromGitter | <sealmove> Araq wtf, don't tease us like this! |
12:08:57 | Araq | hey, sorry. but we want to be able to maintain it |
12:09:30 | FromGitter | <alehander92> Araq i actually want to re-RFC it and get a combo of patty+gara+ast_pattern_matching there :D |
12:09:57 | FromGitter | <alehander92> but i am just bad at fusion reactors and nuclear stuff |
12:10:13 | Araq | but yeah, "pattern matching" is definitely insides fusion's domain |
12:10:17 | FromGitter | <alehander92> (combo like a unified single lib) |
12:13:54 | * | natrys quit (Quit: natrys) |
12:24:09 | Yardanico | I wonder if disruptek will be streaming today |
12:24:26 | Yardanico | disbot: do you know by any chance? |
12:27:28 | Araq | he will |
12:27:39 | Araq | I'm back so he'll stream :P |
12:27:43 | Yardanico | haha |
12:29:04 | Yardanico | well he did some s̶l̶a̶c̶k̶i̶n̶g̶ ̶o̶f̶f̶ streams in last few days |
12:29:19 | Yardanico | like when we tested what would happen if you watch your own stream for too long |
12:29:56 | Yardanico | https://www.twitch.tv/videos/614831993 01:25:00 |
12:31:36 | skrylar[m] | lua coding, it looks like |
12:31:38 | Yardanico | and then I was too sleepy and left my own stream open for 14 hours acidentally |
12:31:59 | Yardanico | skrylar[m]: https://github.com/disruptek/lunacy |
12:32:14 | Yardanico | disruptek came to like lua a lot, said he'll maybe use it for configs and stuff :P |
12:32:18 | Yardanico | because it's fast |
12:32:24 | Yardanico | I mean as config files |
12:34:14 | skrylar[m] | some people do. premake used to be a relevant ting |
12:38:53 | alexander92 | i had a big discussion once with zah |
12:39:08 | alexander92 | about using language vs declarative format for config |
12:39:17 | * | rockcavera joined #nim |
12:39:28 | alexander92 | i still find the first idea (using lua/nim for config) a bit radical |
12:40:10 | alexander92 | people say that https://dhall-lang.org/ fixes a lot of this stuff .. but i never really tried it, has anyone tried that one? |
12:40:18 | Yardanico | we talked about that one here already P |
12:40:19 | Yardanico | :P |
12:40:25 | alexander92 | so whats the conclusion :P |
12:40:29 | Yardanico | no |
12:40:37 | alexander92 | CHANNEL SAYS NO |
12:40:38 | Yardanico | https://irclogs.nim-lang.org/20-04-2020.html#21:09:20 |
12:40:42 | Yardanico | starts here |
12:42:22 | Yardanico | alexander92: THE NIM GODS HAS SPOKEN |
12:42:44 | alexander92 | you're just men, you men! |
12:42:59 | alexander92 | ughhh |
12:43:06 | alexander92 | well its not so much about turing completeness |
12:43:10 | alexander92 | its just about introspection |
12:43:23 | alexander92 | its much easier to introspect/modify a data structure |
12:43:31 | alexander92 | compared to .. actual code in a custom language |
12:43:43 | alexander92 | so thats why configs in the first case seem better to me |
12:45:03 | FromGitter | <bung87> if configuration using language better no other languages, just nim |
12:45:04 | PMunch | I was thinking of using NimScript as a configuration language for my window manager |
12:45:10 | PMunch | Hence my questions earlier |
12:45:32 | alexander92 | also, how do people change settings with UI etc |
12:45:36 | alexander92 | if its mapped to code |
12:45:56 | alexander92 | i think people try to mix *plugins* with *config* in those cases |
12:45:56 | PMunch | For me it's mostly a question of being able to re-use Nim without having to write my own parser for a config format and support whatever features I want |
12:46:05 | alexander92 | if i need to add custom logic, thats a plugin/extension |
12:46:33 | PMunch | I know that with Nim and meta-programming I can have a nice config syntax and be able to add functionality to it |
12:46:36 | alexander92 | but you can just one of the many existing formats that people/tools just understand |
12:46:50 | PMunch | Well, I was using TOML |
12:47:12 | PMunch | But it didn't really work for my usecase as I can't have repeated keys |
12:47:21 | PMunch | So binding multiple keys became an issue |
12:47:22 | alexander92 | but what features would you need for a format .. from a programming languages |
12:47:23 | FromGitter | <bung87> then make it as a package |
12:47:52 | alexander92 | disruptek the lua dsl looks cool |
12:47:55 | PMunch | Well one thing that would be nice is to have it dynamically change based on how many screens I have |
12:48:19 | PMunch | So I can use the same config on all my machines |
12:48:20 | FromGitter | <bung87> I think any script language would be fine |
12:48:30 | PMunch | And detect screen resolutions |
12:48:47 | PMunch | @bung87, Nim has the benefit of macros though |
12:48:57 | PMunch | So you can make it look like a configuration language for the common cases |
12:49:06 | FromGitter | <bung87> https://github.com/qiniu/qlang |
12:49:31 | PMunch | Like in say a nimble file that looks like a plain config file, but then suddenly there's a Nim ternary in there |
12:49:45 | FromGitter | <bung87> the end developer may want more dynamic power |
12:50:04 | alexander92 | bung87 yeah, but my point is that there is a difference between config and extensions |
12:50:18 | alexander92 | getting a bit of dynamic power makes then much harder a lot of other stuff |
12:50:28 | PMunch | Like what? |
12:50:45 | alexander92 | config editing/linting by all kinds of tools |
12:50:49 | alexander92 | representing in the UI |
12:50:52 | FromGitter | <bung87> you can take the idea from qlang |
12:50:57 | alexander92 | programatically changing it |
12:51:15 | alexander92 | e.g. you cant just show a form for your json data structure |
12:51:27 | alexander92 | because now you have to represent somehow "if conditions" |
12:51:29 | * | Guest15212 is now known as dadada |
12:51:30 | alexander92 | and "loops" |
12:51:45 | alexander92 | and a way to flawlessly edit that back in source code |
12:51:55 | PMunch | You don't have to |
12:52:30 | PMunch | As I said, you use the basic features and macros for the 90% usecase, and then allow the user to use the extra power for the last 10% |
12:52:47 | dadada | I don't completely understand the logic behind ident"foo" in macros and procs that are inside macros... I now get undeclared errors, and the only change I made is to assign the ident to a ref object field, before I assigned it to a var ... why should that make something undeclared? |
12:52:55 | alexander92 | but you assume an user that wants to edit source code |
12:53:03 | dadada | also I can't reproduce it on playground yet |
12:53:09 | alexander92 | i dont think i explained it well : |
12:53:22 | alexander92 | if i want the whole config to be mappable to menu in the UI |
12:53:28 | PMunch | Ah, I don't |
12:53:34 | PMunch | Because there is no good reason too |
12:53:40 | alexander92 | this looks like a much harder problem with custom languages |
12:53:52 | alexander92 | i mean, its doable i guess |
12:53:52 | PMunch | All my configurations are text-based |
12:53:57 | alexander92 | but thats you |
12:54:05 | PMunch | Well, that's most Linux people.. |
12:54:07 | alexander92 | many users have different preferences |
12:54:09 | dadada | undeclared identifier: 'foo' <- but why |
12:54:17 | Yardanico | because it's undeclared? :P |
12:54:20 | alexander92 | you'd be surprised imo |
12:54:31 | alexander92 | ok, so if i change my settings |
12:54:37 | Yardanico | dadada: ident"foo" means that you already have (or the user will have) some symbol with the ident "foo" |
12:54:44 | Yardanico | and want to use it in your macro's nodes |
12:54:46 | FromGitter | <bung87> I think alexander told the real use case |
12:54:53 | dadada | Yardanico: when I var blub = ident"foo" # works, when I refobj.field = ident"foo" #why is it now undeclared? |
12:54:55 | PMunch | But again, you can make a UI that will work for 90% of all use-cases and have a fallback for the last 10% |
12:55:08 | alexander92 | the wm would monitor my file (or i would trigger it) and it would reinterpret the config ? |
12:55:14 | alexander92 | PMunch eh .. i am not sure |
12:55:27 | alexander92 | e.g. in my UI the user toggles `.flow` |
12:55:35 | dadada | Yardanico: I know that, but where's the difference between a local var and a local refobj.field that causes this error? |
12:55:44 | Yardanico | I can't understand without more code :D |
12:55:46 | alexander92 | but in the config script somewhere he changes is in the loop: how do you even guess that |
12:55:52 | alexander92 | to change the code correctly |
12:55:56 | dadada | Yardanico: can't reproduce on playground :-( |
12:56:02 | Yardanico | but can locally? |
12:56:04 | PMunch | You could even force the entire thing into one DSL that restricts the syntax slightly, meaning it's easier to parse. So if a field is set to an if statement for example, you represent it with a text field instead of whatever input box you had. |
12:56:05 | Yardanico | send the code :D |
12:56:26 | alexander92 | PMunch and you enter source code there? |
12:56:29 | dadada | Yardanico: working on it, my feeling is once I can reproduce it I can solve it myself ... :D |
12:56:33 | PMunch | Yeah |
12:56:43 | alexander92 | and also , another thing, you cant merge/inherit configs |
12:56:56 | alexander92 | override* |
12:57:01 | PMunch | With the assumption that 90% of the 10% of those who need programming features will just need an if or two |
12:57:01 | alexander92 | e.g. config in ~/.config then overriden partly by local config |
12:57:03 | Yardanico | dadada: don't worry, minimizing stuff is fun too (I can say that after spending about 1.5 hours on minizing a nigui arc issue) |
12:57:08 | Yardanico | :P |
12:57:10 | PMunch | So you don't really need syntax highlighting and such |
12:57:12 | alexander92 | i mean, you can .. but i guess you need to interpret them in order in the same env |
12:57:14 | Yardanico | but it's all for the greater good |
12:57:27 | PMunch | alexander92, that's just the same as any config |
12:57:38 | alexander92 | well merging data structures is not hard :) |
12:57:55 | alexander92 | but yeah, with some work the other might be not hard too |
12:58:05 | PMunch | You start of with a set of variables, you run a Nim script that can change the state, you run another that can change the state further, and after you've run all your scripts in order you have you final state. |
12:58:08 | PMunch | Easy-peasy |
12:58:32 | alexander92 | yeah, just a full blown program run instead of looking at two data structures |
12:58:38 | Araq | fwiw I gave up on nim.cfg, it's simply too messy, I hardcode the logic in extccomp.nim instead |
12:58:39 | alexander92 | and now you can debug your configs |
12:59:08 | Araq | configuration is worse than programming |
12:59:19 | alexander92 | but an `if` or two is all one needs, one can just do that with fields somehow again |
12:59:23 | Araq | as programming is debugable |
12:59:42 | alexander92 | yeah on the other hand one can say that real config = config + the code that interprets it anyway |
12:59:59 | alexander92 | so you still need to debug the actual main app then |
13:00:19 | Araq | I'm still looking for the proof that dhall doesn't give you the simple lambda calculus |
13:00:35 | alexander92 | Araq i dont know dhall, i am arguing for simple toml/yaml/json files |
13:00:56 | alexander92 | but i guess they are all valid choices, i also do like the `if` support in nim.cfg |
13:00:56 | PMunch | True, and why would I spend my time writing a custom configuration thing that has all these complex rules when I can simply say "here are my variables, modify them until you're happy" and then possibly run some sanity check on them. |
13:01:23 | dadada | Yardanico: https://play.nim-lang.org/#ix=2lDT note how b works and c throws this undeclared error |
13:01:32 | PMunch | First thing I did when I was using TOML was to create a custom syntax for variables |
13:01:44 | alexander92 | PMunch but you dont have to write your own format |
13:01:48 | PMunch | So that I could have $mod set to the modifier key I wanted to use and then refer to that later on |
13:01:51 | alexander92 | one needs to adapt *a bit* to an existing one |
13:01:56 | dadada | Yardanico: sorry, I take it back, now they both don't work ... but why |
13:02:01 | PMunch | So I could change the modifier in one place |
13:02:17 | dadada | Yardanico: ah, sorry, I know why |
13:02:23 | Yardanico | because haha is not declared? |
13:02:26 | PMunch | alexander92, until you find a scenario that just won't work in the format you've chosen |
13:02:27 | dadada | Yardanico: the testcase isn't finished, wait a second |
13:02:33 | dadada | Yardanico: yeah, but in the original itis |
13:02:53 | alexander92 | PMunch i think with enough work one can make all those cases work |
13:02:58 | alexander92 | you can make ui for code |
13:03:07 | alexander92 | i can make very custom yaml file |
13:03:08 | alexander92 | :D |
13:03:13 | PMunch | And now you're stuck either forcing it into some clunky structure, abandoning the feature entirely (or make it not very configurable), or change/make a proprietary extension to the configuration format |
13:04:00 | PMunch | Sure you can, but why? Sounds like a lot of work for very little gain |
13:04:13 | alexander92 | but for me your solution sounds like a lot of work |
13:04:41 | alexander92 | its literally embedding a custom script engine + all kinds of other harder stuff on top |
13:04:48 | alexander92 | i still cant easily make a menu for it |
13:05:02 | alexander92 | i still dont understand how to toggle programatically `field2` |
13:05:20 | alexander92 | without just parsing the ast and searching for the field and updating it again |
13:06:46 | alexander92 | or doing some global text replace and hoping one hasnt done *later* some form of for name, value in fields(myObj): myObj.`name` = variable |
13:07:22 | * | thomasross joined #nim |
13:07:25 | * | lritter joined #nim |
13:07:26 | dadada | PMunch: cannot open file: macroutils is not working on playground! |
13:07:38 | PMunch | Well.. Yeah getting NimScript to work might prove tricky |
13:07:43 | PMunch | Just started looking at that :P |
13:07:51 | alexander92 | i mean, it might work well for your usecase , just i think one should be careful with it and not apply it for all kinds of projects |
13:07:53 | Yardanico | dadada: well playground isn't only for testing |
13:07:57 | Yardanico | it's also for sharing code |
13:07:57 | PMunch | But once I make a library that makes that super simple, then it will be easy! |
13:08:02 | Yardanico | even if you can't run it on playground |
13:08:11 | PMunch | dadada, that's strange |
13:08:11 | alexander92 | PMunch :D thats a good attitude i guess |
13:08:37 | alexander92 | sorry it might be very easy to do for your wm, just wanted to show another viewpoint for other kinds of apps/projects |
13:09:12 | PMunch | Yeah I can see how the graphical side might be tricky |
13:10:29 | PMunch | Although you could have a "graphical.nims" file that says on the top ## This file is automatically generated, do not edit. And then have your program run all the scripts first and then this last. |
13:10:33 | dadada | Yardanico: I think the issue I had is that normal quote do can't deal with something like quote do: var `refobj.ident` = "whatever" <- that's why it's probably ending up as undeclared while the var `ident` = "whatever" version worked, so I wanted to see if it works with superQuote, and if stuff like that works with superQuote it should eventually replace the normal quote do IMO |
13:11:03 | PMunch | Then the graphical program could run all the other scripts to populate the fields in the UI and just generate the things you do in the override in a clean file every time. |
13:11:25 | PMunch | So if you wanted to do something with code to override what you did in the GUI you need to put it in a file with precedence |
13:12:01 | PMunch | Basically saying "if you want programming features you have to write it as code" (although you could support a subset of features in the GUI) |
13:12:47 | dadada | no superQuote can't do it either |
13:12:59 | PMunch | dadada, quote do doesn't do that, superQuote can |
13:13:05 | PMunch | It's one of the reasons I wrote it |
13:13:08 | alexander92 | PMunch but what i was afraid for was that |
13:13:17 | alexander92 | you might change something declaratively from the ui |
13:13:18 | FromGitter | <kaushalmodi> @timotheecour Are you here? |
13:13:23 | alexander92 | but to not detect that the code also changes it |
13:13:23 | dadada | PMunch: superQuote gets me Error: request to generate code for .compileTime proc: Lit |
13:14:06 | dadada | PMunch: https://play.nim-lang.org/#ix=2lDW |
13:14:28 | PMunch | Huh.. |
13:14:36 | PMunch | The playground doesn't seem to have any packages |
13:14:39 | PMunch | Weird |
13:15:11 | dadada | test it locally, superQuote can't handle this use case |
13:16:08 | PMunch | Hmmm |
13:16:19 | PMunch | Wait |
13:16:35 | * | thomasross quit (Ping timeout: 260 seconds) |
13:18:04 | PMunch | This works just fine: http://ix.io/2lDX |
13:18:50 | PMunch | So does this: http://ix.io/2lDY |
13:19:10 | PMunch | It's the quote do you have after the superQuote that creates an error |
13:19:26 | Yardanico | I don' think `r.ho` is really supported though |
13:19:32 | Yardanico | or is it? in superQuote? |
13:19:41 | PMunch | It is in superQuote |
13:19:53 | PMunch | As I said, that's part of the reason I wrote it in the first place :) |
13:20:00 | PMunch | I wanted to be able to do stuff like that |
13:20:12 | * | dddddd quit (Ping timeout: 256 seconds) |
13:22:29 | Araq | superQuote, yay |
13:22:48 | dadada | PMunch: why would the second quote do create the error though, the (super)quote dos are supposed to return NimNodes, so I'd expect superQuote to replace `r.ho` with the identifier name, and then I see no reason why the quote do would need to complain, the hard work would be done by your superQuote already? no? |
13:22:57 | PMunch | Araq, huh? |
13:23:02 | Yardanico | PMunch: he likes it maybe :P |
13:23:22 | PMunch | Yardanico, or he hates it :P |
13:23:26 | Yardanico | yeah :D |
13:23:37 | Yardanico | either way that means it's good enough it caught his attention |
13:23:39 | PMunch | dadada, you'd think so, but quote works in mysterious ways |
13:24:00 | PMunch | "You're the worst pirate I've ever heard of" comes to mind |
13:24:28 | Araq | I like the name :-) |
13:24:47 | PMunch | Haha, okay :) |
13:25:05 | PMunch | I couldn't think of one, but it tries to do the same thing as quote, but better |
13:25:12 | PMunch | So I landed on just calling it superQuote |
13:25:18 | * | Cthalupa quit (Ping timeout: 260 seconds) |
13:25:27 | Yardanico | poorMansQuote |
13:25:42 | dadada | PMunch: have you thoroughly tested that superQuote works in all use cases that quote does, because then I'll simply replace all my quote does with it now ... |
13:25:57 | PMunch | While you're here: https://github.com/nim-lang/Nim/pull/14258 Am I missing something here? Or should this check move to further along in the process so that sfImportc is parsed? |
13:25:57 | disbot | ➥ Allow let to not have value when using importc |
13:26:02 | dadada | I'd even consider to just somehow overload quote do with it |
13:26:18 | Yardanico | lol |
13:26:46 | PMunch | dadada, it's mostly untested, but it generates a "quote do" statement in the end IIRC. So with single identifiers it should be pretty much the exact same thing |
13:26:55 | * | Romanson joined #nim |
13:27:02 | * | Cthalupa joined #nim |
13:28:01 | PMunch | Basically what it does is lift stuff like `r.ho` out of the quote. So it makes it into "let tmp123123 = r.ho; quote do: `tmp123123`" |
13:28:11 | dadada | PMunch: "mostly untested" "IIRC" "should be" "pretty much" ... this is not the most reassuring wording!!! |
13:28:25 | * | ftsf quit (Ping timeout: 246 seconds) |
13:29:04 | PMunch | dadada, haha it'll be fiiine |
13:29:33 | PMunch | But seriously, the design of it is sound, so it should work well |
13:29:39 | dadada | PMunch: well it makes sense why it doesn't work with quote do, how would quote do know about the identifier of the temp |
13:29:40 | Yardanico | https://static01.nyt.com/images/2016/08/05/us/05onfire1_xp/05onfire1_xp-superJumbo-v2.jpg |
13:30:17 | PMunch | Wow, that is one high-res meme Yardanico |
13:30:26 | Yardanico | it's from new york times lol |
13:30:44 | dadada | not the identifier, I mean the temp is probably not accessible, or whatever, I've really no clue, I'm just sad that original quote do |
13:30:51 | dadada | has no support for such stuff yet |
13:30:57 | Yardanico | dadada: the original quote do doesn't work because it doesn't understand expressions at all |
13:31:03 | Yardanico | the "temp" stuff is inserted by superQuote |
13:31:08 | Yardanico | it's not there at all with normal quote |
13:31:16 | PMunch | dadada, that's why I created superQuote, so people don't have to be sad :) |
13:31:16 | Yardanico | I mean expressions like ra.ho |
13:31:47 | dadada | Yardanico: yes, I know... I'm probably just ranting because this issue has cost me hours |
13:32:10 | PMunch | No idea why your mixing doesn't work though |
13:32:12 | PMunch | I think it should.. |
13:32:14 | * | abm quit (Read error: Connection reset by peer) |
13:32:50 | PMunch | Oh, apart from that it was using `r.ho` in the normal quote do.. |
13:33:12 | dadada | PMunch: oh, you're right! |
13:33:13 | PMunch | That's probably why it fails |
13:33:49 | dadada | PMunch: yep, I get sloppy when I'm frustrated |
13:33:59 | PMunch | Who doesn't? |
13:34:14 | PMunch | But yeah, just use superQuote and be happy :) |
13:34:56 | dadada | write some test cases, and then lobby Araq to make it the default quote do |
13:35:48 | dadada | pretty please |
13:36:18 | dadada | I love convenience |
13:36:34 | Yardanico | dadada: well only if it's 100% backwards compatible :P |
13:36:58 | PMunch | It should be |
13:36:58 | dadada | Yardanico: that's why I recommend the test cases... there must be some for the old quote do, so superQuote should be tested with those |
13:37:08 | PMunch | Well, not 100%, it doesn't support the same bugs |
13:37:14 | Yardanico | ohno |
13:37:31 | PMunch | It does do some slightly sketchy stuff though.. |
13:38:19 | PMunch | Like it uses parseStmt (or parseExpr, can't remember) https://nim-lang.org/docs/macros.html#parseStmt%2Cstring |
13:38:45 | PMunch | But that's just because the NimNodeKind for `` is a bit odd |
13:39:06 | dadada | dude, you're the worst seller of your own code ever, "mostly untested" "IIRC" "should be" "pretty much" "it does do some slightly sketchy stuff though.." |
13:39:24 | PMunch | "makes you happy" |
13:39:36 | PMunch | I'm just trying to manage expectations here :P |
13:40:11 | PMunch | If I told you it was awesome 100% test-coverage, Covid free, solves world hunger |
13:40:24 | PMunch | Imagine how let down you would be if it didn't work |
13:40:41 | * | opal quit (Quit: No Ping reply in 180 seconds.) |
13:40:45 | PMunch | Now you can only be positively surprised by how well it works |
13:41:02 | * | opal joined #nim |
13:42:03 | PMunch | macroutils (and all the other packages) should be available in the playground again |
13:42:13 | PMunch | Not quite sure why they weren't |
13:42:51 | Araq | dadada, should be in fusion :P |
13:43:13 | dadada | what's fusion? |
13:44:18 | Yardanico | !repo fusion |
13:44:19 | disbot | https://github.com/nim-lang/fusion -- 9fusion: 11Fusion is for now an idea about how to grow Nim's ecosystem without the pain points of more traditional approaches. Time will tell if the idea is a good one. 15 37⭐ 2🍴 7& 1 more... |
13:46:28 | disruptek | oh shit araq is back |
13:46:33 | Yardanico | yep |
13:46:39 | Yardanico | you better stream IC dev today :D |
13:46:52 | dadada | we have the worst sales people here "Time will tell if the idea is a good one" ... imagine apple going ... so the iPhone is an idea how to create a communication device without the pain points of traditional approaches. Time will tell if the idea is a good one. We think the device should work as expected if we can recall correctly. It does some sketchy things though. We don't want you to get any high |
13:46:55 | * | PMunch quit (Ping timeout: 260 seconds) |
13:46:56 | disruptek | yeah, i have to fix my blocker bug. |
13:46:57 | dadada | expectations. 2000$ |
13:47:18 | Yardanico | dadada: open source software development != commerical marketing |
13:47:32 | Yardanico | people in open source are *usually* more honest |
13:48:11 | dadada | Yardanico: thanks captain obvious, I'm using humour which is using hyperbole to get across that we shouldn't undersell ourselved, overselling is not good either |
13:48:12 | disruptek | software development is all about managing expectation. |
13:48:26 | Yardanico | dadada: sorry I didn't see it as humour :P |
13:49:19 | dadada | np :P |
13:50:49 | Araq | dadada, well the idea of a mono-repo to reduce the testing overhead from A*B*C*D*... down to 2*2 so that stuff actually works is controversial |
13:51:33 | Araq | ;-) |
13:56:25 | * | liblq-dev quit (Ping timeout: 246 seconds) |
13:58:37 | * | liblq-dev joined #nim |
14:02:23 | * | zacharycarter joined #nim |
14:28:41 | FromDiscord | <Prodigle> I'm struggling to divide 2 int64's |
14:28:41 | FromDiscord | <Prodigle> proc CalculatePrimes(number: var int64):seq[int64] = |
14:28:41 | FromDiscord | <Prodigle> var start = cpuTime() |
14:28:42 | FromDiscord | <Prodigle> var primeNumbers: seq[int64] |
14:28:42 | FromDiscord | <Prodigle> for i in 2..number: |
14:28:42 | FromDiscord | <Prodigle> while number mod i == 0: |
14:28:44 | FromDiscord | <Prodigle> primeNumbers.add(i) |
14:28:45 | FromDiscord | <Prodigle> number = number/i |
14:28:47 | FromDiscord | <Prodigle> individual.writeLine( (cpuTime()-start)* 1000) |
14:28:48 | FromDiscord | <Prodigle> echo("Completed") |
14:28:50 | FromDiscord | <Prodigle> return primeNumbers |
14:29:03 | FromDiscord | <Generic> use div for integer division |
14:30:04 | * | exelotl quit (Ping timeout: 272 seconds) |
14:30:39 | Araq | and don't use 'var T' parameters if you don't understand Nim's mutability rules |
14:31:05 | narimiran | and don't go above `sqrt(number)` ;) |
14:31:32 | FromDiscord | <Prodigle> What do you mean by the var T param? |
14:31:38 | Yardanico | "number: var int64" |
14:31:48 | FromDiscord | <Prodigle> Var makes it mutable no? |
14:32:08 | Yardanico | you can just do "var number = number" inside of the proc to make a mutable copy for your own proc |
14:32:19 | FromDiscord | <Generic> var on parameters means you can pass in a variable to be modified by that proc |
14:32:22 | Yardanico | and with current definition you should always declare your numbers with "var" so they can be used with CalculatePrimes |
14:32:32 | Yardanico | and the original number will get modified |
14:32:58 | FromDiscord | <Prodigle> That's fine 🙂 |
14:34:19 | * | leorize quit (Remote host closed the connection) |
14:35:08 | * | leorize joined #nim |
14:35:45 | narimiran | and what exactly does your proc really do? |
14:36:19 | narimiran | put 24 as "number" and suddenly 4 is a prime, if i'm executing this in my head correctly |
14:37:38 | narimiran | no, wait :D |
14:37:40 | FromDiscord | <Prodigle> Nah it comes up with 2 and 3 |
14:37:43 | FromDiscord | <Prodigle> but 2 is repeated |
14:37:46 | FromDiscord | <Prodigle> so I need to look at that |
14:38:19 | FromDiscord | <Prodigle> It's basically just dummy code for some timings |
14:39:42 | * | ptdel joined #nim |
14:40:08 | FromDiscord | <Prodigle> I do have an issue that a ported version of this code in C# is taking under a second to calculate for 24265915380 but is still going in Nim |
14:40:34 | Yardanico | show the C# code (please use a paste service) |
14:40:45 | Yardanico | and did you compile with -d:release or -d:danger ? |
14:40:51 | FromDiscord | <Prodigle> with release |
14:41:24 | FromDiscord | <Prodigle> https://pastebin.com/N4Wx2f0z |
14:41:51 | FromDiscord | <Prodigle> func at the bottom |
14:42:39 | narimiran | put nim version on https://play.nim-lang.org/ |
14:43:05 | FromDiscord | <Prodigle> https://play.nim-lang.org/#ix=2lEk |
14:43:36 | FromDiscord | <Prodigle> ah |
14:43:37 | FromDiscord | <Prodigle> runs fine |
14:44:20 | Yardanico | also you might want to use std/monotimes for benchmarking instead |
14:44:23 | FromDiscord | <Prodigle> Anything wrong with my flags? nim c --run .\main.nim --threads:on -d:release --opt:speed |
14:44:45 | Yardanico | completes instantly for me here |
14:44:48 | Yardanico | I mean your code with -d:release |
14:44:50 | leorize | looks fine to me |
14:45:11 | leorize | though that code should be refactored to use result |
14:46:02 | leorize | looks like the C# version even use parallel computations |
14:46:15 | leorize | though it'd actually make things slower for this use case afaict |
14:47:39 | FromDiscord | <Prodigle> I think so yeah, I'll bump up the numbers when they're both working |
14:47:49 | * | nsf quit (Quit: WeeChat 2.8) |
14:47:49 | FromDiscord | <Prodigle> Still looking at a post 40 second run on my PC |
14:47:58 | FromDiscord | <Prodigle> even with all the timing code and streams taken out |
14:48:11 | Yardanico | it literally completes in a second for me |
14:48:12 | leorize[m] | you should keep the timing code |
14:48:14 | Yardanico | I mean less |
14:48:27 | leorize[m] | binaries generated by gcc usually got caught in windows defender |
14:48:29 | Yardanico | takes 4ms for me |
14:48:32 | Yardanico | lol |
14:48:45 | Yardanico | I mean it takes 2ms but total binary time is 4ms |
14:48:49 | leorize[m] | most of your time will be spent waiting for the binary to actually be executed :P |
14:49:14 | FromDiscord | <Prodigle> Running constant at about 10% cpu usage |
14:49:23 | Yardanico | try to disable antivirus software really |
14:50:12 | FromDiscord | <Prodigle> Real time protection is off hmm |
14:52:17 | FromDiscord | <Prodigle> Other nim programs work fine still |
14:52:24 | FromDiscord | <Prodigle> Can't even think what's wrong here |
14:52:32 | Yardanico | me neither |
14:52:35 | Yardanico | maybe your C compiler is broken :P |
14:52:36 | FromGitter | <kaushalmodi> Araq: Can I source one config.nims in another? |
14:52:38 | Yardanico | try to recompile it |
14:52:44 | Yardanico | I mean the nim file |
14:52:46 | leorize | I'll try to tweak your nim version a bit |
14:52:51 | Yardanico | nim c -f -d:release file.nim |
14:53:05 | Yardanico | --opt:speed is superfluous here btw |
14:53:11 | Yardanico | since -d:release already implies it |
14:53:26 | FromDiscord | <Prodigle> Gotcha |
14:53:30 | FromDiscord | <Prodigle> recompiled with no difference |
14:53:41 | * | deepend_ is now known as deepend |
14:54:18 | Yardanico | well I really think it's not the Nim who's at fault there :P |
14:54:25 | Yardanico | maybe OS is doing some weird stuff, idk |
14:54:43 | FromDiscord | <Prodigle> Yeah |
14:54:46 | Yardanico | https://play.nim-lang.org/#ix=2lEo |
14:55:05 | Yardanico | it runs on playground with quite fast speed considering playground doesn't compile in release mode |
14:55:13 | * | deepend quit (Quit: o/) |
14:55:32 | FromDiscord | <Prodigle> Task Manager showing 9.5-10% cpu usage and 0.4MB memory |
14:55:37 | * | deepend joined #nim |
14:55:37 | FromDiscord | <Prodigle> nothing super out of the ordinary |
14:59:42 | disruptek | ~stream |
14:59:42 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
14:59:52 | disruptek | compiler shit. |
14:59:53 | Yardanico | ^ go join mumble bois |
15:01:11 | shashlick | disruptek: just tagged nimterop last night |
15:01:17 | disruptek | nice. |
15:01:49 | * | abm joined #nim |
15:02:50 | shashlick | https://github.com/nimterop/nimterop/blob/master/CHANGES.md |
15:04:25 | Araq | http://www.pathsensitive.com/2019/07/the-best-refactoring-youve-never-heard.html |
15:08:55 | * | Vladar joined #nim |
15:09:09 | FromDiscord | <Prodigle> So it finally finished at 6 minutes... |
15:09:11 | FromDiscord | <Prodigle> hmm |
15:09:20 | * | Cthalupa quit (Ping timeout: 272 seconds) |
15:10:23 | alexander92 | guys |
15:10:25 | * | Cthalupa joined #nim |
15:10:26 | alexander92 | so what is the pattern |
15:10:29 | alexander92 | to return early from async |
15:10:48 | leorize | `return` doesn't work? |
15:11:24 | alexander92 | no! |
15:11:27 | alexander92 | the problem is that |
15:11:41 | leorize | use disruptek's technique then: wrap your proc body in a named block, then `break namedBlock` |
15:11:45 | alexander92 | `async` seems to require producing a `complete(retFuture..)` |
15:11:49 | alexander92 | etc before return |
15:11:54 | alexander92 | so when i produce a return |
15:11:56 | alexander92 | from a macro |
15:12:02 | alexander92 | it just returns nil without completing |
15:12:11 | alexander92 | and this leads to an assertion error |
15:12:36 | FromDiscord | <Prodigle> Do you have a code example? |
15:12:41 | alexander92 | hm, interesting |
15:12:45 | alexander92 | this might work, thanks |
15:13:02 | alexander92 | other option is to expose an `earlyReturn` template from async |
15:13:15 | alexander92 | which does the completion correctly |
15:13:23 | alexander92 | this seems to maybe work for my case |
15:13:30 | alexander92 | but the break thing sounds smart |
15:13:50 | alexander92 | ugh but .. this requires changing all the async functions i use.. |
15:13:57 | alexander92 | the macro in |
15:14:32 | * | sz0 joined #nim |
15:15:20 | alexander92 | another option is to expose the internal future as some kind of special variable |
15:15:39 | alexander92 | e.g. nimAsyncdispatchRetFuture |
15:16:33 | alexander92 | the best would be to somehow redefine return itself as a template similar to await |
15:22:26 | * | sentreen_ quit (Quit: sentreen_) |
15:23:46 | * | sentreen joined #nim |
15:24:00 | * | sentreen quit (Client Quit) |
15:24:08 | * | sentreen joined #nim |
15:34:07 | * | sentreen quit (Read error: Connection timed out) |
15:34:26 | * | sentreen joined #nim |
15:34:34 | FromGitter | <sheerluck> Until Araq linked that talk about "Best Refactoring" it never occurred to me that most of you are haskell programmers as well. |
15:34:41 | Yardanico | lol? |
15:36:29 | narimiran | most of us? |
15:40:53 | Yardanico | almost none of us |
15:43:38 | FromGitter | <sheerluck> narimiran oh you are an OCaml programmer, I see |
15:44:07 | narimiran | haha, i did some stuff in ocaml, but calling myself "ocaml programmer" might be a stretch :) |
15:47:11 | leorize[m] | Yardanico, @Prodigle: here's the translation of the C# code into Nim, this one don't do parallel though: https://play.nim-lang.org/#ix=2lEJ |
15:47:20 | leorize[m] | also Yardanico, the code crashes on ARC |
15:47:24 | Yardanico | thanks |
15:48:16 | FromDiscord | <mratsim> @sheerluck, Haskell with while loop? |
15:48:45 | leorize[m] | this is the new bridge, right? pings should reach the other side, yes? |
15:48:48 | Yardanico | no |
15:48:51 | Yardanico | this is old bridge still |
15:49:06 | Yardanico | because discord stopped sending full member list to my bot and I need to implement it myself now :) |
15:49:14 | Yardanico | also KrispPurg needs to do some crash fixes for the ib |
15:49:31 | leorize | maybe someone could ping Prodigle for me :P |
15:49:39 | leorize | see if that code runs faster or slower than C# |
15:49:45 | leorize | I won't bet on it being fast though :P |
15:49:48 | FromDiscord | <Yardanico> @Prodigle |
15:50:00 | FromDiscord | <Prodigle> Yup |
15:50:32 | FromDiscord | <Prodigle> ? |
15:50:38 | FromDiscord | <Prodigle> Oh |
15:51:14 | leorize | the only optimization that can be done left here is to move calculatePrimes out of main() |
15:51:23 | leorize | this makes calculatePrimes stop being a closure |
15:51:36 | leorize | I kept it in because it's the closest to the C# version |
15:51:42 | Yardanico | leorize: it crashes because of cursor |
15:51:47 | Yardanico | removing it makes it work with arc |
15:51:55 | leorize | oh lol I forgot I put that in |
15:52:11 | leorize | wonder why it crashes though |
15:52:58 | FromDiscord | <Prodigle> Invalid pragma cursor |
15:53:05 | Yardanico | old nim? |
15:53:08 | Yardanico | which one you're on? |
15:53:13 | Yardanico | nim -v |
15:53:21 | FromDiscord | <Prodigle> Potentially, haven't updated in a couple months |
15:53:24 | FromDiscord | <Prodigle> nim -v |
15:53:41 | FromDiscord | <Prodigle> 1.0.6 |
15:53:51 | leorize | the latest is 1.2 |
15:53:55 | FromDiscord | <Prodigle> XD |
15:53:56 | leorize | but that version isn't too old |
15:54:03 | leorize | you can remove the cursor pragma |
15:54:25 | leorize | I didn't test if it's any faster/slower with/without it |
15:54:30 | FromDiscord | <Prodigle> Runs like expected at least |
15:54:35 | FromDiscord | <Prodigle> couple seconds |
15:54:39 | leorize | it's an optimization for --gc:arc only |
15:54:55 | FromGitter | <kaushalmodi> narimiran: Should be have a Releases landing page on nim-lang.org? |
15:54:58 | FromDiscord | <Prodigle> Thanks 🙂 No idea what the problem was beforehand |
15:55:08 | FromGitter | <kaushalmodi> Right now, one needs to know to go to https://nim-lang.org/blog.html to see release notes |
15:55:11 | disruptek | !rfc 177 |
15:55:13 | disbot | https://github.com/nim-lang/RFCs/issues/177 -- 3Unify Nim's GC/memory management options |
15:55:30 | narimiran | what would be the content of that page? |
15:55:32 | FromGitter | <kaushalmodi> Instead it would be nice to have a separate https://nim-lang.org/releases.html or https://nim-lang.org/new.html just for releases and special announcements |
15:55:35 | leorize | Prodigle: different code I guess :P |
15:55:46 | FromGitter | <kaushalmodi> narimiran: Release notes of course |
15:56:00 | FromDiscord | <Prodigle> Thanks again 🙂 |
15:56:17 | FromGitter | <kaushalmodi> If a newcomer visits the nim-lang page, they are more likely to click on "Releases" than "Blog" |
15:56:26 | FromGitter | <kaushalmodi> they would want to know "What's New" |
15:56:44 | leorize | calling it "What's New" sounds better than "Releases" :P |
15:57:01 | FromGitter | <kaushalmodi> sure |
15:57:09 | FromGitter | <kaushalmodi> but we need a separate landing page :) |
15:57:32 | FromGitter | <kaushalmodi> "Blog" sounds a bit "non-serious" for a topic of weight like release notes |
15:57:32 | leorize | I think we need an actual designer to help us with this :P |
15:58:21 | leorize | > Support for various backends: it compiles to C, C++ or JavaScript so that Nim can be used for all backend and frontend needs. |
15:58:26 | leorize | I think we should remove this line |
15:58:43 | leorize | the "compiles to C, C++" triggers people for whatever the reason |
15:58:43 | Yardanico | because some people think compiling to C is not cool? :D |
15:59:40 | leorize | people thought that "compiles to C" == "is C" |
15:59:55 | Yardanico | lol |
16:00:06 | leorize | advertise it as really good interop with C and C++ sounds better |
16:00:06 | Yardanico | but they see examples on the right |
16:00:13 | Yardanico | they don't look like C for me |
16:00:27 | leorize | people don't care, the C-word triggers them |
16:00:45 | leorize | even D's author got into the trap saying that "D don't compile to C because of C limitations" |
16:00:58 | Yardanico | what limitations |
16:01:07 | leorize | don't ask me, ask him :P |
16:01:18 | leorize | I saw that on HN one day and he never replied to any comments |
16:01:36 | Araq | leorize, the real question is how to write docs for people who refuse to read |
16:02:33 | Araq | and also, if we really want to consider these people our target audience |
16:03:29 | leorize | I also saw honest questions about "if Nim compiles to C, then that mean I gotta take the C and compile it to get the binary?" |
16:03:32 | leorize | on reddit iirc |
16:03:50 | Yardanico | but C compiles to asm so I gotta take the asm and compile it to binary? |
16:04:03 | leorize | does any C compiler advertise that? |
16:06:02 | shashlick | Agree, website should talk about interop but not backends |
16:06:24 | shashlick | That's already documented in backend.html and only for interested parties |
16:09:13 | leorize | and the "compiles to C" part kinda lures people into thinking that Nim generates the kind of C code you'd write |
16:10:25 | shashlick | Fact though is that opinions keep everyone away from all sorts of things |
16:10:44 | Araq | just like GCC produces human-readable asm code, I guess |
16:11:51 | leorize | also our landing page is too big |
16:12:03 | shashlick | Oh gc, oh whitespace, oh generics, whatever |
16:12:06 | leorize | I need to scroll a full page on my laptop to get to the "Install" button |
16:12:09 | alexander92 | Araq the "everyone should read the whole manual and remember 15 gotchas" is a very small niche to fill |
16:12:33 | shashlick | I think it is fair to keep the website crisp and high level |
16:12:47 | shashlick | Since most people don't read, me included |
16:13:01 | alexander92 | i just dont understand if any humans operate like this: trying and guessing is just how humans act imho |
16:13:27 | leorize | comparing our landing page to: https://www.rust-lang.org/, https://crystal-lang.org/, https://www.python.org/ |
16:13:33 | leorize | ours is a bit bloated |
16:14:28 | leorize | the first big "click me" button you see on the others are "Get Started", "Install", "Try", "Download" |
16:14:39 | leorize | we have, uh, a menu bar and a lot of text |
16:15:32 | Araq | leorize, I agree |
16:15:42 | Araq | we already trimmed it down a bit |
16:15:57 | leorize | I think we need a restructural of the landing page |
16:16:03 | leorize | the layout just doesn't work |
16:16:51 | leorize | we have plenty of places to steal ideas from :p |
16:17:32 | Araq | alexander92, I don't see an alternative. If you cannot comprehend X, what makes us think you can comprehend Y instead. |
16:18:08 | Araq | there is a limit to how moronic you can become and still get away with it |
16:18:19 | alexander92 | i don't think this is relevant |
16:19:05 | alexander92 | no one wants to read a n-thousand word technical document and remember all the edge cases / idioms mentioned in it |
16:19:06 | FromDiscord | <mratsim> there was this language which had a drop down that showcased mini-programs in that language |
16:19:22 | alexander92 | before actually start playing with it |
16:19:27 | shashlick | if you crash by raising an exception, does the quitProc still get called |
16:19:32 | FromDiscord | <mratsim> https://github.com/nim-lang/website/issues/168 |
16:19:32 | disbot | ➥ Sliders to display more examples |
16:19:35 | leorize | mratsim: go have something like that |
16:19:41 | leorize | https://golang.org/ |
16:20:03 | leorize | I personally think that our current layout doesn't work |
16:20:06 | * | Senketsu quit (Quit: WeeChat 2.8) |
16:20:09 | alexander92 | i just think people naturally often read just enough to do what they want to |
16:20:11 | FromDiscord | <mratsim> see inko: https://inko-lang.org/ |
16:20:17 | FromDiscord | <mratsim> I'm OK with the layout |
16:20:25 | alexander92 | so inevitably they get surprised from time to time |
16:20:35 | Araq | so what |
16:20:38 | alexander92 | but i am talking about non-surprising api-s/errors |
16:20:45 | leorize | mratsim: I can't even find the "Install" button without scrolling a page :P |
16:20:46 | alexander92 | maybe we're just talking about different things :D :D :D |
16:20:59 | leorize | that's the difference between our layout and others |
16:21:03 | Araq | alexander92, you're talking about how designed Nim before v1 |
16:21:26 | Araq | there is always some rule and it's always surprising for some, so let's have more rules |
16:22:07 | Araq | see also how C++ got its symbol resolution rules in templates |
16:22:38 | Araq | this way of designing things doesn't work, ymmv |
16:22:45 | alexander92 | no, rules and specs are great, my point was only that one can have both: great docs and api-s/errors/hints trying to prevent silly user misuages |
16:22:54 | alexander92 | misusages* |
16:23:08 | alexander92 | of course, one can only go some distance, but both are possible to some extent |
16:23:36 | leorize | do we have anyone on staff to take care of the design? it's not urgent but it'd be nice if we get a cleaner landing page before 1.4 is out |
16:23:39 | alexander92 | after all, the less possible way there are for one to butcher some kind of construct/api, the better |
16:23:48 | Araq | leorize, yes, narimiran |
16:25:24 | narimiran | ok, but can we be more precise what is "better", "cleaner", etc.? |
16:26:03 | * | dddddd joined #nim |
16:26:05 | leorize | view the site in 1366 x 768 resolution, then look at other langs pages |
16:26:16 | leorize | you'll find the difference really fast :P |
16:27:32 | leorize | wait, the first part of our page doesn't even fit on a FHD screen... |
16:27:53 | FromDiscord | <clyybber> I don't get it |
16:28:22 | narimiran | ok, what should be removed? |
16:28:32 | leorize | not removed per-se, but moved |
16:28:51 | leorize | is it really necessary that we bombards everyone with info when they first arrive? |
16:29:04 | * | Vladar quit (Quit: Leaving) |
16:29:26 | leorize | give them a quick overview, some buttons that take them to resources to install Nim and/or to try Nim |
16:29:33 | FromDiscord | <clyybber> is it really neccessary we use 1366 x 768 to display 3 words :p ? |
16:29:42 | leorize | expand on the language in the following section |
16:30:00 | leorize | that's pretty much how every other languages do |
16:30:19 | leorize | clyybber: well that screen res is still the most popular |
16:30:28 | leorize | (I for one, still own a laptop with that res :P) |
16:31:04 | FromDiscord | <clyybber> yeah, and I find its pretty fine |
16:31:07 | narimiran | "Gentlemen, a short view back to the past. Two years ago, our users told us: ....... Less content, more? Or less and more comunication with your websites." |
16:31:09 | FromDiscord | <clyybber> better than rusts tbh |
16:31:13 | Yardanico | leorize: most popular where? :P |
16:31:20 | narimiran | (now, lets see if anybody recognizes this reference) |
16:31:22 | Yardanico | did you do a survey for software developers? |
16:31:25 | Yardanico | narimiran: I do :D |
16:31:39 | FromDiscord | <clyybber> leorize: Most often people with those screens *complain* that it looks like a mobile site |
16:31:43 | FromDiscord | <clyybber> not the other way around :D |
16:31:48 | shashlick | @zacharycarter - still looking for that cimgui wrapper? |
16:32:04 | narimiran | Yardanico: the best interview question ever!! :) |
16:32:10 | zacharycarter | shashlick: mmm not really looking I am using nimterop |
16:32:15 | zacharycarter | to produce one |
16:32:18 | FromDiscord | <clyybber> I guess we could move the three mantras to the top |
16:32:27 | FromDiscord | <clyybber> but other than that I think its best to stay as is |
16:32:34 | leorize | Yardanico: according to web design analytics, not sure which one, since I heard it from a friend studying graphic design |
16:32:40 | zacharycarter | I was just commenting on nimterop skipping types due to type aliases appearing before type definitions |
16:32:47 | leorize | I trust designers more than programmers trying to design things :P |
16:32:51 | narimiran | we don't want users with poor screens :P :D |
16:33:07 | shashlick | @zacharycarter - ast2 is now released and you don't need to do all that |
16:33:11 | shashlick | forward declarations work |
16:33:20 | Yardanico | i don't really understand people who judge a language by the webpage |
16:33:34 | FromDiscord | <clyybber> leorize: But its not designers reading our webpage but programmers |
16:33:46 | FromDiscord | <clyybber> And programmers usually value having actual information on the screen |
16:33:50 | * | exelotl joined #nim |
16:34:03 | leorize | you can say that but almost everything you use has gone through a designer hands |
16:34:03 | zacharycarter | shashlick: cool! I'll try upgrading |
16:34:39 | shashlick | here's the command - `toast -pnr -E_ -F_ -f:ast2 -DCIMGUI_DEFINE_ENUMS_AND_STRUCTS cimgui.h` |
16:34:49 | shashlick | only thing you need to set is `type Bool = bool` |
16:34:55 | shashlick | but i'm planning on fixing that as well |
16:34:59 | leorize | well we have google analytics on Nim's front page, right? |
16:35:04 | leorize | how long do people spend there? |
16:35:23 | Yardanico | we do? |
16:35:23 | leorize | how much do they scroll? etc |
16:35:31 | leorize | yes, yes we do |
16:35:35 | Yardanico | ah yeah I see ublock origin blocking GA |
16:35:37 | Yardanico | :P |
16:36:17 | leorize | when was the last time we even look at those analytics lol |
16:37:00 | FromDiscord | <clyybber> can you simply say what you think is wrong with the site? |
16:37:08 | leorize | I already did lol |
16:37:15 | Yardanico | how it looks on smaller screens? |
16:37:20 | leorize | too much text, little to no interactivity |
16:37:33 | Yardanico | well we may want to add links to playground for code examples |
16:37:38 | Yardanico | so users can change the code I guess |
16:37:47 | Yardanico | and run it |
16:38:13 | leorize | http://0x0.st/i_6r.png |
16:38:18 | leorize | ^ if you wanna see what I see |
16:38:23 | Yardanico | that looks fine for me |
16:38:28 | Yardanico | really |
16:38:37 | Yardanico | there's just enough info |
16:38:37 | leorize | ignore the borders :P it's a firefox setting |
16:38:49 | Yardanico | yeah I can do the same in chrome to see 1366x768 |
16:39:07 | * | liblq-dev quit (Ping timeout: 260 seconds) |
16:39:34 | Yardanico | so IMO that stuff is all subjective |
16:39:44 | FromGitter | <Knaque> This might be a stupid question, but (hopefully I'm explaining this well) is it possible for a module to import another into the global scope? |
16:39:47 | Yardanico | it might look bad for you but not for some other people |
16:39:57 | Yardanico | @Knaque you mean to import another module and export it? |
16:39:59 | narimiran | leorize: so we should put "install" and "learn nim" buttons at the top, before the "efficient" heading? |
16:40:07 | leorize | I'm just constrasting it with every other pages: http://0x0.st/i_6s.png, http://0x0.st/i_6z.png |
16:40:11 | FromGitter | <Knaque> Yep, that sounds right. |
16:40:22 | Yardanico | import module <newline> export module |
16:40:48 | * | liblq-dev joined #nim |
16:40:50 | Yardanico | https://nim-lang.org/docs/manual.html#modules-export-statement |
16:40:56 | FromDiscord | <clyybber> ok, so install button to the top, learn nim, try nim to the top |
16:41:01 | FromDiscord | <clyybber> and the three mantras to the top |
16:41:06 | FromGitter | <Knaque> Much thanks! |
16:41:17 | FromDiscord | <clyybber> leorize: Do you agree? |
16:41:49 | leorize | sounds like improvement |
16:41:55 | leorize | it'd be nice to have a preview |
16:42:11 | narimiran | ok, i'll try it, you'll have a PR and a screenshot tomorrow |
16:42:35 | narimiran | or maybe even now :) |
16:42:42 | leorize | you should run through some of the comments on the forum about the landing page too |
16:42:50 | narimiran | link? |
16:43:08 | * | dadada quit (Ping timeout: 256 seconds) |
16:43:32 | leorize | I don't have it here :P |
16:43:36 | Yardanico | https://forum.nim-lang.org/t/6319 |
16:44:06 | * | dadada joined #nim |
16:44:29 | * | dadada is now known as Guest28990 |
16:45:45 | leorize | narimiran: do you have access to our analytics as well? |
16:45:49 | narimiran | nope |
16:45:58 | leorize | ping dom96 I guess |
16:47:05 | leorize | personally I think this sentence should be reworded: "Support for various backends: it compiles to C, C++ or JavaScript so that Nim can be used for all backend and frontend needs." |
16:47:54 | leorize | something along the lines of "generating fast native binaries or JS for all backend and frontend needs" |
16:48:30 | leorize | the backend thing is meaningless to anyone without experience |
16:49:06 | * | solitudesf quit (Remote host closed the connection) |
16:49:33 | * | solitudesf joined #nim |
16:51:43 | narimiran | leorize: better? https://i.imgur.com/0BoVn6Z.jpg |
16:52:01 | leorize | narimiran: when you're done, please open an article on the forum asking for feedback too :) we should have the community at large reflect on the website and not just me :P |
16:52:26 | narimiran | 100 people, 100 opinions |
16:52:28 | leorize | the flow looks weird though :/ |
16:52:44 | * | krux02 joined #nim |
16:52:55 | leorize | note points that matters |
16:53:16 | leorize | usually there will be something that's in common that will stick out in all feedbacks |
16:54:07 | narimiran | https://imgur.com/pHZvcQe ? |
16:54:27 | Yardanico | hmm that doesn't look bad |
16:55:04 | leorize | we can make the efficent points and the examples their own section, right? |
16:55:13 | leorize | it's right below a small heading so people won't miss it |
16:55:32 | leorize | you can invert the bg color if you want the code snippets to have dark bg |
16:55:58 | leorize | eg. the heading light bg, next section dark bg |
16:56:16 | narimiran | i can even put the version number there |
16:56:30 | narimiran | so people can immediately tell what is the latest stable version |
16:56:41 | leorize | yea that sounds good |
16:56:56 | leorize | a small "release notes" link there would be nice too |
16:57:12 | leorize | also can we finally have the playground linked on the front page? |
16:57:26 | leorize | most new users don't even realise we have a playground lol |
16:57:28 | narimiran | https://imgur.com/KCd9Hzu |
16:57:36 | narimiran | oh yeah, playground should have a link there too |
16:57:53 | Yardanico | and if we can do that implement so that users can play with the code from examples in playground |
16:57:57 | Yardanico | we can just have predefined links or something |
16:58:02 | narimiran | yep |
16:59:00 | leorize | narimiran: maybe the version should be in a caption right below |
16:59:03 | leorize | like how rust do it |
16:59:26 | leorize | crystal also do it like that too |
17:08:46 | * | chapl joined #nim |
17:09:08 | chapl | I did join the IRC |
17:09:09 | chapl | yay |
17:10:33 | Yardanico | chapl: yay |
17:10:42 | chapl | irssi ftw |
17:10:48 | chapl | *triggered* |
17:11:20 | chapl | surprised that irssi's able to run on windows |
17:12:52 | Yardanico | chapl: btw fyi we have #nim-offtopic :P |
17:13:13 | FromGitter | <bung87> https://github.com/bung87/ts2nim it can transpile its self now |
17:13:31 | * | chapl left #nim (#nim) |
17:13:34 | Araq | bung87: can you now please move the html stuff to fusion |
17:13:48 | shashlick | Araq: had a question on code reordering |
17:14:00 | * | titanomachy joined #nim |
17:14:10 | * | Cthalupa quit (Ping timeout: 246 seconds) |
17:14:11 | shashlick | it doesn't work on code that is generated via macro or parseString |
17:14:19 | FromGitter | <bung87> do I need rename the relatived lib name ? |
17:14:22 | shashlick | it doesn't work if the code is included either |
17:14:41 | shashlick | only if you have an import module, it works within that module |
17:14:46 | FromGitter | <bung87> as it same as std lib name, I just using relative import avoiding conflicts |
17:14:46 | Araq | shashlick, well it's 'experimental' for a reason, maybe we can fix it though |
17:14:50 | shashlick | is this as expected? |
17:16:16 | * | Cthalupa joined #nim |
17:16:55 | Araq | bung87: you will be able to import it as 'import fusion / htmlparser' |
17:16:58 | * | leorize[m] uploaded an image: Screenshot_2020-05-11 Nim Programming Language.png (168KB) < https://kde.modular.im/_matrix/media/r0/download/asra.gr/IQOQExXjGnjztqMuBetmnxnf > |
17:17:09 | leorize[m] | narimiran: ^ did a small mockup |
17:17:11 | shashlick | I opened this a couple days ago as well on codeReordering interaction with pragmas - https://github.com/nim-lang/Nim/issues/14290 |
17:17:29 | FromGitter | <bung87> @Araq so I just need move all file under src/htmlparser? |
17:17:56 | FromGitter | <bung87> src/fusion/htmlparser |
17:19:54 | FromGitter | <bung87> ok I get it just follow nimble structure |
17:20:31 | narimiran | leorize[m]: i'll try to do something like that |
17:23:41 | * | trui quit (Quit: WeeChat 2.3) |
17:24:03 | * | chapl joined #nim |
17:24:29 | * | chapl quit (Remote host closed the connection) |
17:25:07 | * | chapl joined #nim |
17:25:30 | chapl | accidentally pressed ctrl+c, oof |
17:26:41 | * | chapl quit (Client Quit) |
17:27:03 | * | opal quit (Ping timeout: 240 seconds) |
17:27:55 | Araq | leorize[m], fusion now has code in it and tests, please do your CI magic |
17:28:22 | FromGitter | <bung87> @Araq done. |
17:28:45 | Araq | wow thanks |
17:28:49 | Araq | that was fast |
17:29:06 | * | nsf joined #nim |
17:29:12 | FromGitter | <bung87> :) |
17:30:41 | * | opal joined #nim |
17:31:36 | FromGitter | <kaushalmodi> Araq: Dumb question.. shouldn't each fusion package live in its own subdir? |
17:31:53 | FromGitter | <kaushalmodi> that way that subdir could have it's own tests dir, etc |
17:33:39 | FromGitter | <bung87> using one config is well, as the lib will test every gc |
17:34:27 | FromDiscord | <kraptor> Hi, don't know if this has been already reported, but I ran into differente behavior depending on how I declare the same (sematically the same) object type https://play.nim-lang.org/#ix=2lFh |
17:34:50 | FromDiscord | <kraptor> I was expecing to get everything "true"... but for some reason I get different behavior for TEST_OBJECT_ref2 :/ |
17:36:33 | FromDiscord | <kraptor> tried to find something similar in reported bugs, but my search-fu seems broken today |
17:38:18 | FromDiscord | <kraptor> ohhh... my fault, had to declare the later as "TEST_OBJECT_ref2 {.union.} = ref object {.union.}" |
17:38:38 | Yardanico | that's a bug then |
17:38:46 | Yardanico | because you'll then get " Warning: type pragmas follow the type name; this form of writing pragmas is deprecated [Deprecated]Э |
17:39:36 | FromDiscord | <kraptor> interesting, defining it as "TEST_OBJECT_ref2 = ref object {.union.}" works too... |
17:42:35 | leorize[m] | narimiran: more concept art: https://0x0.st/i_6I.png |
17:42:43 | Yardanico | i don't like white :P |
17:42:44 | leorize | don't ask for the code though, I did all this in inspector tool |
17:43:15 | leorize | it's just for the really small heading :P |
17:43:28 | Yardanico | well i don't really like it that way |
17:43:31 | Yardanico | I mean the color |
17:43:50 | leorize | ah yea, I just randomly picked the colors :P |
17:44:48 | leorize | it's a concept to describe the kind of flow I got in my head |
17:44:57 | leorize | I'll let narimiran decide how to design it |
17:45:45 | narimiran | that will end well.... :P :D |
17:48:10 | leorize[m] | I also have this kind of flow too: https://0x0.st/i_6G.png |
17:48:21 | leorize[m] | but then I decided that I like the previous one better |
17:48:55 | leorize | please do look around and don't use these verbatim :P |
17:49:33 | FromGitter | <bung87> narimiran spell like japanese |
17:49:46 | Yardanico | wdym? |
17:50:41 | FromGitter | <bung87> it can represent japanese prounce |
17:50:56 | * | hoijui joined #nim |
17:51:43 | * | couven92 joined #nim |
17:51:46 | narimiran | huh? |
17:52:32 | FromGitter | <bung87> I am on bed now cant type japanese on my mobile show it |
17:55:32 | * | fredrikhr quit (Ping timeout: 260 seconds) |
17:55:43 | FromDiscord | <codic> How can i generate a random alphanumeric string? |
17:55:47 | FromDiscord | <codic> of size 16 |
17:55:56 | narimiran | just smash your keyboard |
17:56:03 | narimiran | and then take first 16 characters |
17:56:07 | FromGitter | <bung87> hhhhh |
17:56:11 | leorize[m] | lol |
17:56:24 | FromDiscord | <codic> no no no |
17:56:26 | FromDiscord | <codic> I mean with nim |
17:56:28 | FromDiscord | <codic> xd |
17:56:44 | Yardanico | it's easy |
17:56:46 | Yardanico | use sample |
17:57:10 | leorize | does it take a set[T]? |
17:57:14 | Yardanico | yep |
17:57:18 | leorize | niceee |
17:57:25 | Yardanico | https://nim-lang.org/docs/random.html#sample%2Cset%5BT%5D |
17:57:47 | FromDiscord | <codic> yeah ik but how do I get a string of all letters and numbers? manually |
17:57:48 | FromDiscord | <codic> yeah ik but how do I get a string of all letters and numbers? manually? |
17:58:11 | Yardanico | !eval import random; for x in 0..16: stdout.write sample(Letters + Digits) |
17:58:15 | NimBot | Compile failed: /usercode/in.nim(1, 52) Error: undeclared identifier: 'Letters' |
17:58:23 | Yardanico | !eval import random; import strutils; for x in 0..16: stdout.write sample(Letters + Digits) |
17:58:27 | NimBot | dSvvoO6pIOYKII0fi |
17:58:28 | Yardanico | see |
17:58:35 | Yardanico | https://nim-lang.org/docs/strutils.html#Letters |
17:58:36 | FromDiscord | <codic> thanks |
17:59:26 | FromGitter | <bung87> strong memory yardanico |
17:59:33 | Yardanico | ? |
17:59:51 | * | Guest28990 quit (Ping timeout: 260 seconds) |
18:00:19 | leorize[m] | I guess they meant that you have good memory |
18:00:26 | Yardanico | yeah I understood that :P |
18:00:37 | FromDiscord | <codic> And how do I append to a file? |
18:00:43 | Yardanico | file.write |
18:00:45 | FromDiscord | <codic> Is there an appendFile? |
18:00:45 | FromDiscord | <codic> Oh |
18:00:49 | Yardanico | stdout is just a file handle |
18:00:59 | leorize[m] | remember to open the file with fmAppend |
18:01:05 | FromDiscord | <codic> alright |
18:01:50 | * | Cthalupa quit (Ping timeout: 256 seconds) |
18:02:02 | * | chapl joined #nim |
18:03:16 | FromDiscord | <kraptor> @Yardanico i filled an bug and tried to explain as best as I could, thanks |
18:03:21 | * | Cthalupa joined #nim |
18:04:01 | FromDiscord | <codic> So I got https://hatebin.com/flqsoqmnqn |
18:04:22 | FromDiscord | <codic> now see what my problem is is that after first run, it doesn't append anything on second run. |
18:04:35 | Yardanico | also do f.flushFile() |
18:05:23 | leorize | remember to close the file |
18:05:27 | Yardanico | he does defer |
18:05:53 | leorize | close will flush the file |
18:06:14 | narimiran | 0..16 --> you have off by one if you want 16 characters ;) |
18:06:46 | * | dadada joined #nim |
18:07:09 | * | dadada is now known as Guest85945 |
18:07:44 | FromDiscord | <codic> true |
18:07:53 | FromDiscord | <codic> wait so why doesn't it append anything? |
18:08:22 | narimiran | put `var y:string` outside of for loop |
18:09:13 | narimiran | maybe. |
18:10:08 | FromDiscord | <codic> but it should generate a new one every time |
18:10:16 | narimiran | btw, why not a simple `y.add(sample(....))`? |
18:10:34 | FromGitter | <kaushalmodi> !eval import random; import strutils; var str: string; for i in 0 .. 15: str.add(sample(Letters + Digits)); echo str |
18:10:38 | NimBot | d↵dS↵dSv↵dSvv↵dSvvo↵dSvvoO↵dSvvoO6↵dSvvoO6p↵dSvvoO6pI↵dSvvoO6pIO↵dSvvoO6pIOY↵dSvvoO6pIOYK↵dSvvoO6pIOYKI↵dSvvoO6pIOYKII↵dSvvoO6pIOYKII0↵dSvvoO6pIOYKII0f |
18:10:55 | narimiran | yeah, i misunderstood what you wanted, sorry |
18:11:14 | FromGitter | <kaushalmodi> hmm, how do I make that echo fall outside that for loop in that oneliner? |
18:11:23 | narimiran | parentheses |
18:11:32 | FromGitter | <kaushalmodi> cool |
18:11:48 | * | narimiran quit (Quit: leaving) |
18:15:08 | * | Senketsu joined #nim |
18:20:50 | * | Romanson quit (Quit: Connection closed for inactivity) |
18:21:15 | * | chapl quit (Changing host) |
18:21:15 | * | chapl joined #nim |
18:24:34 | FromDiscord | <Technisha Circuit> Is there any other nim interpreters/repls besides the one nim has by default? |
18:26:38 | Yardanico | inim |
18:26:42 | Yardanico | but it's a fake REPL imo :P |
18:26:45 | FromDiscord | <codic> So I got to https://hatebin.com/vmnsupkvwq. but now i get a file like |
18:26:45 | FromDiscord | <codic> ``` |
18:26:45 | FromDiscord | <codic> d |
18:26:45 | FromDiscord | <codic> S |
18:26:46 | FromDiscord | <codic> v |
18:26:46 | FromDiscord | <codic> v |
18:26:46 | FromDiscord | <codic> o |
18:26:46 | FromDiscord | <codic> O |
18:26:48 | FromDiscord | <codic> 6 |
18:26:49 | FromDiscord | <codic> p |
18:26:50 | Yardanico | don't paste like that |
18:26:50 | FromDiscord | <codic> I |
18:26:51 | FromDiscord | <codic> O |
18:26:53 | FromDiscord | <codic> Y |
18:26:53 | Yardanico | please |
18:26:54 | FromDiscord | <codic> K |
18:26:55 | FromDiscord | <codic> I |
18:26:56 | FromDiscord | <codic> I |
18:26:58 | FromDiscord | <codic> 0 |
18:26:59 | FromDiscord | <codic> f |
18:27:00 | FromDiscord | <codic> i |
18:27:01 | FromDiscord | <codic> ``` |
18:27:03 | FromDiscord | <codic> oh yeah sorr |
18:27:04 | FromDiscord | <codic> y |
18:27:12 | chapl | :D |
18:27:13 | FromDiscord | <codic> https://hatebin.com/fbmtatnrfy |
18:27:18 | chapl | hatebin?xD |
18:27:27 | chapl | wtf |
18:27:43 | FromDiscord | <codic> ¯\_(ツ)_/¯ |
18:28:02 | FromDiscord | <arnetheduck> `nlvm` has a branch that implements jit execution with `llvm` - turning that into a repl would be easy |
18:28:16 | FromDiscord | <Technisha Circuit> Thanks |
18:28:59 | FromDiscord | <codic> So I don't get why it just pastes 16 characters - ALWAYS the same - into the file. any ideas? |
18:29:07 | Yardanico | randomize() |
18:29:22 | Yardanico | you need to randomize the seed for the random number generator |
18:29:35 | Yardanico | https://nim-lang.org/docs/random.html#basic-usage |
18:29:49 | FromDiscord | <codic> ah. |
18:29:51 | Yardanico | https://play.nim-lang.org/#ix=2lFG |
18:29:55 | Yardanico | a bit more nice looking code :P |
18:30:21 | FromDiscord | <codic> is anyone predicting my purpose here? |
18:30:27 | Yardanico | yeah I already did |
18:30:29 | FromDiscord | <codic> lol |
18:30:32 | Yardanico | but the chance is really low |
18:30:36 | FromDiscord | <codic> thanks worked! |
18:30:38 | FromDiscord | <codic> true |
18:30:54 | leorize | don't use the random module if you want true random though |
18:31:06 | Yardanico | leorize: for his purpose it's fine |
18:31:18 | FromDiscord | <codic> yeah |
18:33:53 | FromGitter | <sheerluck> question to Araq: can the knowledge from "The Best Refactoring You've Never Heard Of" be applied to Nim in a way that we can banish "defer: f.close()" from Nim? What is the most Nim-ish place to call "f.close()" in Nim-without-defer? |
18:34:52 | leorize | use destructors and you'll never have to care about close() |
18:36:23 | FromGitter | <sheerluck> so https://nim-lang.org/docs/destructors.html |
18:36:45 | leorize | once things stablize we will adapt the stdlib to embrace it |
18:36:48 | * | hoijui quit (Quit: Leaving) |
18:37:39 | FromGitter | <sheerluck> that is great. |
18:37:54 | Yardanico | that document is mostly for internal usage btw |
18:37:59 | Yardanico | it's not an "end-user guide" yet ;) |
18:44:01 | chapl | What's wrong with defer-ing? |
18:51:17 | FromDiscord | <Technisha Circuit> How would i do `not in` in Nim? |
18:51:31 | FromDiscord | <Technisha Circuit> Because that isn't valid apparently |
18:51:40 | solitudesf | notin |
18:53:11 | FromDiscord | <Technisha Circuit> Oh thanks :P |
18:53:55 | FromDiscord | <Technisha Circuit> I'm also doing the same thing as @codic :P |
18:54:06 | FromDiscord | <Technisha Circuit> I wonder if there is a way to verify the link :/ |
18:54:10 | FromDiscord | <Yardanico> Also you can have not_in if you really want :D |
18:54:16 | FromDiscord | <Technisha Circuit> O |
18:54:18 | FromDiscord | <Yardanico> Or nOtIn |
18:54:18 | FromDiscord | <Technisha Circuit> Coolio |
18:54:22 | FromDiscord | <Technisha Circuit> Why? |
18:54:28 | FromDiscord | <Yardanico> or nOTIN |
18:54:30 | FromDiscord | <Technisha Circuit> nOtIn is just why? |
18:54:33 | FromDiscord | <Technisha Circuit> Oh god |
18:54:35 | FromDiscord | <Yardanico> Because you can |
18:54:38 | FromDiscord | <Technisha Circuit> Case insensitive nim |
18:54:52 | FromDiscord | <Yardanico> Partially |
18:55:35 | FromDiscord | <codic> if thing notIn thing ftw |
18:56:11 | FromDiscord | <codic> ```nim |
18:56:11 | FromDiscord | <codic> template `not in`(x,y:string)= x notin y |
18:56:11 | FromDiscord | <codic> ``` |
18:56:22 | FromDiscord | <codic> or better |
18:56:34 | FromDiscord | <codic> ```nim |
18:56:34 | FromDiscord | <codic> template [T]`not in`(x,y:T)= x notin y |
18:56:34 | FromDiscord | <codic> ``` |
18:56:36 | alexander92 | does this work? |
18:56:39 | alexander92 | :) |
18:56:54 | alexander92 | if it did nim would be able to parse a lot of random stuff imo |
18:57:16 | alexander92 | keep in mind the ident operators syntax is limited |
18:57:26 | alexander92 | you can use all kinds of `@` `!` etc iirc |
18:57:32 | alexander92 | but not all kinds of idents |
18:57:34 | FromDiscord | <codic> lemme see |
18:58:02 | alexander92 | the problem is that it clashes with `not` and `in` maybe |
18:58:15 | FromDiscord | <Yardanico> Yeah |
18:58:17 | FromDiscord | <codic> o |
18:58:43 | FromDiscord | <codic> Oof type mismatch |
18:58:49 | FromDiscord | <codic> but i used generics :9 |
18:58:55 | FromDiscord | <codic> probs because the clash |
18:59:40 | FromGitter | <sheerluck> chapl https://play.nim-lang.org/#ix=2lFM |
19:01:09 | FromDiscord | <codic> does nimpy support decorators for using a python library in nim? |
19:01:13 | FromDiscord | <codic> if so are they just pragmas? |
19:01:34 | Prestige | Is there a way to change the order of objects in an OrderedSet? |
19:01:40 | FromDiscord | <Yardanico> Aren't they just Python functions |
19:01:45 | Prestige | I'm attempting to swap two elements in particular |
19:01:54 | FromDiscord | <Yardanico> So you can call them explicitly? |
19:02:45 | FromDiscord | <codic> they are technically |
19:02:48 | FromDiscord | <codic> So yeah |
19:03:08 | FromDiscord | <Yardanico> So call a decorator with the function itself as an argument |
19:03:48 | FromDiscord | <Yardanico> And if you mean wrap a Nim proc in a Python decorator - do that in Python side |
19:05:43 | FromDiscord | <codic> I actually do mean that, i'm trying to use the flask module |
19:05:44 | FromDiscord | <codic> In nim |
19:05:56 | FromDiscord | <codic> i know jester exists |
19:06:22 | FromDiscord | <Yardanico> Uhhh |
19:06:29 | FromDiscord | <Yardanico> I don't think that's the way to go |
19:06:33 | FromDiscord | <codic> Neither do I |
19:07:01 | FromDiscord | <codic> ¯\_(ツ)_/¯ |
19:08:18 | alexander92 | noooope |
19:08:26 | alexander92 | this is not a good idea |
19:08:40 | alexander92 | you neither get to use normal idiomatic nim, nor speed or etc |
19:08:58 | alexander92 | you can try to use jester, it is a sinatra-like small framework |
19:09:03 | alexander92 | so it should be similar in scope to flask |
19:09:29 | alexander92 | decorators can be immitated, but often ruby-like block api-s |
19:09:32 | alexander92 | seem better in nim imho |
19:09:42 | FromDiscord | <codic> ruby blocks ftw |
19:09:43 | alexander92 | its subjective |
19:09:55 | alexander92 | yeah, you can easily do similar things with templates here |
19:09:59 | * | tane joined #nim |
19:10:22 | FromDiscord | <Technisha Circuit> @codic I'm letting the link gen run for a while now |
19:10:35 | FromDiscord | <codic> Nice |
19:10:46 | alexander92 | disruptek https://news.ycombinator.com/item?id=23144444 |
19:11:03 | FromDiscord | <Technisha Circuit> I need a way to verify the links ;-; |
19:11:26 | alexander92 | i already agree with you that discarding itself shouldn't be forbidden, but i just want to show another example that some way of linting stuff like this *is* useful |
19:11:50 | alexander92 | maybe when we have nim linter this can be in |
19:13:28 | FromDiscord | <Yardanico> @Technisha Circuit do it then |
19:13:37 | FromDiscord | <Yardanico> check how Discord itself verifies it via http requests |
19:13:40 | FromDiscord | <Yardanico> and replicate that |
19:13:43 | FromDiscord | <Technisha Circuit> I have no idea how though |
19:13:45 | FromDiscord | <Technisha Circuit> Oh |
19:13:52 | FromDiscord | <Technisha Circuit> Good idea but I'm on mobile rn ;-; |
19:15:02 | FromDiscord | <Yardanico> https://discord.com/api/v6/entitlements/gift-codes/tbV99DlLxSEqDews?with_application=true&with_subscription_plan=true |
19:15:47 | FromDiscord | <Technisha Circuit> Oh thanks |
19:15:58 | FromDiscord | <Technisha Circuit> :P |
19:16:49 | FromDiscord | <Technisha Circuit> What data do I need to send to it and what would a valid gift return? |
19:17:59 | Yardanico | check yourself |
19:18:16 | FromDiscord | <Technisha Circuit> Okay, thanks :P |
19:18:33 | FromDiscord | <codic> how do I get json data from a get request? |
19:18:43 | Yardanico | you mean parse? |
19:18:45 | Yardanico | parseJson |
19:18:47 | FromDiscord | <Technisha Circuit> In python it's `response.text` |
19:18:48 | Yardanico | from json module |
19:18:50 | FromDiscord | <codic> ah thank you |
19:18:54 | Yardanico | getContent returns text |
19:18:57 | FromDiscord | <Technisha Circuit> :P |
19:18:58 | Yardanico | get returns a Response |
19:19:31 | Yardanico | also good luck getting banned by discord or cloudflare |
19:19:38 | FromDiscord | <KrispPurg> is there a way to do getOrDefault for tables that the default value is an Option, or a similar? |
19:19:43 | FromDiscord | <KrispPurg> lol |
19:19:51 | Yardanico | @KrispPurg it just works, no? |
19:20:03 | FromDiscord | <codic> boom https://hatebin.com/kyikdoyvtq |
19:20:05 | * | D_ quit (Ping timeout: 240 seconds) |
19:20:19 | Yardanico | @codic parsing here is overhead |
19:20:30 | Yardanico | I reallly don't see why would you parse that simple json every time :P |
19:21:02 | * | D_ joined #nim |
19:21:07 | FromDiscord | <codic> Nvm, wrong url |
19:21:07 | FromDiscord | <codic> Yeah I could check for `Unknown Gift Code` in the string |
19:21:08 | FromDiscord | <codic> Doing that |
19:21:57 | FromDiscord | <codic> https://hatebin.com/gjgpiftcnb |
19:21:57 | FromDiscord | <Yardanico> @KrispPurg https://play.nim-lang.org/#ix=2lFS |
19:21:58 | FromDiscord | <KrispPurg> On json module, there is https://nim-lang.org/docs/tables.html#getOrDefault%2CTable%5BA%2CB%5D%2CA%2CB and there is no support for returning default specific types. |
19:22:05 | FromDiscord | <codic> I'm not going to be running this though |
19:22:31 | FromDiscord | <Yardanico> also @KrispPurg can you push your fixes to devel? my bot crashes a lot |
19:22:39 | FromDiscord | <KrispPurg> okay |
19:22:50 | * | Zunaka joined #nim |
19:23:03 | FromDiscord | <Yardanico> all in gateway.nim(670) handleDispatchIter |
19:23:13 | FromDiscord | <KrispPurg> guild member updates? |
19:23:17 | Yardanico | yep |
19:23:17 | Zunaka | Hey, what's the discord link? |
19:23:23 | * | Guest85945 is now known as dadada |
19:23:29 | Yardanico | https://discord.gg/ezDFDw2 |
19:23:37 | Zunaka | Thanks! |
19:23:52 | * | dadada is now known as Guest22369 |
19:23:59 | FromDiscord | <KrispPurg> hold on |
19:24:36 | Guest22369 | let's say I've a big module where I want to unit test certain sub-procs in order to ensure that they work correctly, but I don't want to export them because they're internal funcs/procs, but that also means they're not available in a unittest module because you can't import them... what to do there? |
19:24:48 | Yardanico | Guest22369: use inclued |
19:24:50 | Yardanico | include* |
19:24:53 | * | Guest22369 is now known as dadada |
19:25:04 | Yardanico | when isMainModule: include mytests |
19:25:11 | Yardanico | and write tests which test that stuff in mytests |
19:26:41 | FromDiscord | <KrispPurg> Yardanico it's pushed now |
19:26:51 | Yardanico | thanks |
19:26:58 | * | couven92 is now known as fredrikhr |
19:27:28 | FromDiscord | <KrispPurg> the demon error has escaped. |
19:27:28 | FromDiscord | <KrispPurg> https://youtube.com/watch?v=SSW2yFieV3c&t=6m2s |
19:29:31 | FromDiscord | <KrispPurg> anyways, I can do that, but I mean like default that is different to the value type. |
19:29:41 | Yardanico | you can only have 1 type |
19:29:50 | Yardanico | because a variable can only have 1 type |
19:30:01 | Yardanico | you can't just say "ok we can decide at runtime which type this variable will be" |
19:30:09 | Yardanico | use object variants if you want that :P |
19:30:14 | FromDiscord | <KrispPurg> rip |
19:31:04 | Prestige | I remember there was a shorthand way to get an element from the end of an array but can't recall the syntax. Anyone know what it is? |
19:31:09 | Yardanico | ^1 |
19:31:13 | Yardanico | arr[^1] |
19:31:27 | * | Vladar joined #nim |
19:31:28 | Prestige | thanks |
19:33:56 | * | liblq-dev quit (Quit: WeeChat 2.8) |
19:37:20 | FromDiscord | <Yardanico> @KrispPurg btw please use https://github.com/nitely/nim-regex instead of "re" so your lib will not depend on any libraries 🙂 |
19:37:48 | FromDiscord | <Yardanico> you only seem to use it in 1 place but even then it'll require pcre.so (or pcre.dll on Windows) |
19:38:42 | FromDiscord | <Yardanico> i mean it won't depend on any native libraries |
19:39:21 | FromDiscord | <KrispPurg> mkay |
19:39:25 | * | nsf quit (Quit: WeeChat 2.8) |
19:39:34 | * | Jesin quit (Quit: Leaving) |
19:40:32 | FromDiscord | <KrispPurg> I wouldn't have to change anything, but the module? |
19:40:46 | FromDiscord | <Yardanico> well you'll have to probably, but it's not hard, |
19:41:02 | FromDiscord | <Yardanico> nim-regex is mostly compatible with PCRE syntax except backreferences and backtracking |
19:41:06 | FromDiscord | <KrispPurg> im asking cuz im feelin a bit lazy rn |
19:42:07 | FromDiscord | <codic> what's wrong with the inbuilt nre https://nim-lang.org/docs/nre.html tho |
19:42:12 | FromDiscord | <codic> or re https://nim-lang.org/docs/re.html |
19:43:09 | FromDiscord | <Yardanico> The fact that you'll also need pcre native module |
19:43:17 | FromDiscord | <Yardanico> Since they both use it |
19:43:21 | FromDiscord | <codic> ah, i see |
19:43:25 | * | Jesin joined #nim |
19:43:29 | FromDiscord | <codic> then using nim-regex seems better |
19:43:45 | FromDiscord | <codic> or for pattern matching pegs |
19:45:01 | FromDiscord | <Yardanico> npeg yeah |
19:45:22 | FromDiscord | <Yardanico> They both will probably end up in Fusion anyway |
19:45:28 | * | titanomachy quit (Ping timeout: 272 seconds) |
19:45:33 | FromDiscord | <Yardanico> I mean npeg and nim-regex |
19:46:35 | FromDiscord | <codic> o |
19:47:03 | FromDiscord | <Yardanico> !repo Fusion |
19:47:10 | FromDiscord | <codic> !repo fusion |
19:47:14 | FromDiscord | <codic> welp |
19:47:23 | FromDiscord | <Yardanico> Ah right disbot is turned off |
19:47:39 | FromDiscord | <Yardanico> https://github.com/nim-lang/fusion |
19:48:06 | leorize[m] | Araq: are we gonna use testament on fusion or just plain ol' `nimble test`? |
19:51:11 | leorize | also what version of the compiler are we going to test against? |
19:51:29 | leorize | I can do multiple versions if needed |
19:55:51 | * | ptdel quit (Remote host closed the connection) |
19:57:17 | FromDiscord | <exelotl> is there a way I can run `fmt` on a string that was pulled in via `staticRead`? |
19:58:00 | * | filcuc joined #nim |
19:58:18 | FromDiscord | <exelotl> I'm trying this but getting an error: 'staticRead' can only be used in compile-time context https://pastebin.com/raw/YJqDX91V |
19:58:21 | * | chapl left #nim (#nim) |
19:59:31 | alexander92 | and oii |
19:59:38 | alexander92 | are you making a template engine |
19:59:46 | alexander92 | great stuff |
20:00:18 | FromDiscord | <exelotl> Yeah trying to make a super simple 3 line template engine lol |
20:00:26 | alexander92 | yeah i did that with karax |
20:00:27 | alexander92 | iirc |
20:01:00 | alexander92 | i returned karax tree-s written in file as result of procs |
20:01:05 | FromDiscord | <exelotl> I've tried several variations e.g. using a helper template to put the staticRead into a const before sending it to the macro, but I still get the same error :| |
20:01:30 | alexander92 | it should be possible imo |
20:01:42 | alexander92 | noo |
20:01:43 | alexander92 | i get it |
20:01:49 | alexander92 | you cant newLit with that |
20:01:57 | Prestige | Any docs on inline procs? Like, similar to a ternary |
20:02:00 | alexander92 | newLit would need a literal string man |
20:02:56 | alexander92 | try with `newStrLitNode` |
20:02:59 | leorize | Prestige: inline procs? |
20:03:10 | FromDiscord | <exelotl> Oh, I'll try that after dinner |
20:03:15 | alexander92 | or if not, generate a call to `view2(staticRead(str))` |
20:03:17 | Prestige | essentially a ternary statement (even though we don't have those in nim) |
20:03:20 | Prestige | leorize: ^ |
20:03:21 | alexander92 | and then in view2 you can do |
20:03:25 | alexander92 | :) |
20:03:50 | leorize | Prestige: we do have ternary statements, just not super short |
20:03:54 | leorize | :P |
20:04:25 | Prestige | e.g. let a = proc(): int = if true: 1 else 2 |
20:04:40 | leorize | you nailed the syntax |
20:04:47 | Prestige | well damn okay |
20:04:55 | Prestige | I couldn't find it documented anywhere lol |
20:05:09 | FromDiscord | <Yardanico> If expressions |
20:05:16 | leorize | it's too intuitive :P |
20:05:22 | * | solitudesf- joined #nim |
20:05:39 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#statements-and-expressions-if-expression |
20:05:56 | FromDiscord | <Yardanico> You just have to understand the difference between statements and expressions :) |
20:05:57 | Prestige | Thanks @Yardanico |
20:06:36 | * | konvertex quit (Quit: quit) |
20:07:25 | * | arecaceae quit (Remote host closed the connection) |
20:07:36 | FromDiscord | <exelotl> This is the thing I always found hard about learning nim: you have to know what the thing is called before you can find the docs for it |
20:07:58 | FromDiscord | <exelotl> Once you cross that threshold it gets a lot easier |
20:08:11 | FromDiscord | <exelotl> And the situation isn't as bad as it used to be |
20:08:16 | * | solitudesf quit (Ping timeout: 272 seconds) |
20:08:18 | * | arecaceae joined #nim |
20:08:34 | FromDiscord | <Yardanico> Well how would you solve it? |
20:09:18 | FromDiscord | <exelotl> I wish I had a good answer x) |
20:10:31 | leorize | find out how most people call certain features then add reference to them to the manual |
20:10:42 | leorize | makes it easy for them to do a text search :p |
20:11:12 | * | konvertex joined #nim |
20:21:15 | stefantalpalaru | Have you ever seen tables not being garbage collected? It starts to look like that here, where an array of 2 tables keeps replacing its members with new tables, but the GC heap doesn't go down: https://github.com/status-im/nim-beacon-chain/pull/1007 |
20:22:41 | FromDiscord | <clyybber> stefantalpalaru: Does it occur with markandsweep or boehm too? |
20:23:42 | * | Senketsu quit (Ping timeout: 260 seconds) |
20:25:13 | Prestige | leorize: How would I go about doing that? I'd like to add "ternary" to the "If expression" section |
20:26:07 | stefantalpalaru | I can't use Boehm (or even the default GC switched to malloc: https://gist.github.com/stefantalpalaru/79105fb6e7e724733cacb14fd94d4b1c) due to a weird attempt to deallocate in the middle of an allocated region: https://gist.github.com/stefantalpalaru/5515af7eea62499aaa1f2de1af075c3c |
20:26:18 | leorize | Prestige: you gotta pull off some clever sentences :P |
20:27:21 | skrylar[m] | hoi |
20:27:41 | Prestige | I must find the nim website/manual and submit a pr |
20:27:59 | leorize | Prestige: usually "This feature is similar to ternary operators in other languages" works |
20:28:05 | leorize | the manual is in nim-lang/Nim |
20:28:07 | leorize | docs/manual.rst |
20:28:11 | Prestige | nice, thanks |
20:29:41 | FromDiscord | <exelotl> Yeah that's good |
20:32:53 | * | zagani joined #nim |
20:37:10 | * | zagani left #nim (#nim) |
20:39:37 | nikita` | I'm reading notes and code I did for system integration ~3 years ago. different PM, but if nim itself gets installed to $prefix/nim/ and nimble installs packages to $prefix/nimble/pkgs/ is that canonical? I can't find any consensus about the location for distributors or I forgot to document it |
20:42:18 | leorize | it's in docs/packaging.md |
20:42:43 | * | NimBot joined #nim |
20:45:52 | nikita` | ok, that's for nim itself. but nim packages, as in sources I can define a generalized build procedure for and use nimble to handle it.. do they expect a standard location for themselves, did the nim community agree on a location, or ...? |
20:46:11 | * | zagani joined #nim |
20:46:12 | leorize | unfortunately, no |
20:46:25 | leorize | nimble doesn't even support a system-installation location for packages |
20:47:06 | nikita` | okay. I just hook on to nimble, it works for what I define. |
20:47:15 | nikita` | ie like |
20:47:17 | nikita` | ERROR: /usr/work/devel/nim-nake/work/.destdir/usr/pkg/nim/pkgs/bin/nake |
20:47:30 | nikita` | nvm the error, that's pkgsrc plist generation |
20:47:59 | * | solitudesf- quit (Remote host closed the connection) |
20:48:26 | FromGitter | <sheerluck> Oh Nikita You will never know anything about my home. I'll never know how good it feels to hold you |
20:50:34 | nikita` | leorize: okay, creeps I can't filter out aside, since it seems no one has done this since I last had this conversation 3 years ago, maybe it's just up to experimenting. |
20:50:58 | leorize | well you have me to ask |
20:51:00 | leorize | also federico3 |
20:51:13 | leorize | we are the only packagers for nim afaik |
20:51:19 | leorize | also stefantalpalaru iirc |
20:52:14 | nikita` | I'm working on adding support for it to pkgsrc. I have some 3/4th finished, never upstreamed material for Guix which I am building on as comparison |
20:52:15 | leorize | nikita`: currently the compiler supports multiple nimble dir |
20:52:20 | federico3 | FWIW see https://nim-lang.github.io/Nim/packaging.html |
20:52:23 | leorize | but funny enough nimble doesn't support this |
20:52:59 | leorize | https://github.com/nim-lang/nimble/issues/80 |
20:53:08 | nikita` | federico3: okay, this is about nake and other applications, not nim itself :) |
20:53:25 | nikita` | thanks |
20:53:39 | leorize | currently there's no consensus, purely because nimble doesn't support this |
20:53:57 | leorize | for my packages I put them in /usr/share/nimble |
20:54:10 | leorize | but nimble can't use this dir so deps resolution will never take it into account |
20:54:15 | leorize | making it completely useless |
20:54:57 | nikita` | hm |
20:56:29 | federico3 | nikita`: I feel your pain, packaging is the biggest pain point of the language |
20:56:56 | * | Vladar quit (Quit: Leaving) |
20:58:00 | nikita` | i think i'll read into the ticket and get back to you within the next weeks. |
20:58:21 | FromGitter | <kaushalmodi> leorize: you can symlink the ~/.nimble to wherever you have the pkgs installed? |
20:58:45 | leorize | we are doing packaging |
20:58:59 | leorize | the point here is to make it work seemlessly with the user |
20:59:18 | leorize | ie. the user should be able to `nimble install` and have their own nimble directory |
20:59:21 | nikita` | and not introduce sideeffects |
20:59:24 | FromGitter | <kaushalmodi> For nimble pkgs deployed at work, I have a Nim alias with --nimblePath (or something like that) |
21:00:03 | FromDiscord | <Technisha Circuit> Is there an OS that uses Nim mainly if not completely? |
21:00:09 | leorize | nope |
21:00:18 | FromDiscord | <Technisha Circuit> Aw |
21:00:25 | FromDiscord | <Technisha Circuit> Ik there's one is Golang |
21:00:29 | federico3 | huh? |
21:00:33 | FromDiscord | <Technisha Circuit> But it's sad that Nim doesn't have one |
21:00:42 | federico3 | good |
21:00:42 | FromDiscord | <Technisha Circuit> An OS written in Nim |
21:00:47 | leorize | kaushalmodi: yea but the integrating with the system is different |
21:00:52 | FromDiscord | <Technisha Circuit> Why good? |
21:01:25 | federico3 | you mean a kernel or the userspace tooling or "everything"? |
21:01:36 | FromDiscord | <Technisha Circuit> Everything |
21:01:50 | FromDiscord | <Technisha Circuit> Any would be fine tho |
21:02:40 | FromDiscord | <Technisha Circuit> https://github.com/dom96/nimkernel is a kernel written in Nim |
21:03:30 | federico3 | that's a toy kernel |
21:03:51 | FromDiscord | <Technisha Circuit> Wdym? |
21:08:01 | * | filcuc quit (Ping timeout: 264 seconds) |
21:08:06 | shashlick | can cligen read flags from a file? |
21:10:22 | FromGitter | <deech> I don't seem to be able to use a custom `task build, "": ...` to work with `nimble build`. That task and any `before build:...` hook is ignored. Is this a new change? |
21:10:49 | leorize | sounds like a bug to me |
21:11:56 | dadada | krux02: I'm beginning to understand you more, compiler bugs are destroying my workflow now |
21:12:55 | dadada | Error: internal error: getTypeDescAux(tyProxy)Error: internal error: getTypeDescAux(tyProxy)# |
21:13:10 | dadada | it works if I include the type, or copy+paste the code into the module |
21:13:21 | dadada | but if I import it, the upper error appears ... |
21:14:56 | dadada | at that point you lose faith in Nim |
21:14:58 | xace | what would be the easiest way to run a exectuable in the background ? I just want to have the program launched, i dont care about the output or errorcode, in c i would system("myprogram &> /dev/null"); |
21:15:17 | leorize | startProcess() |
21:15:18 | dadada | but I don't want to... it's just wtf, this is such a simple thing, it should never fail |
21:15:45 | dadada | xace: (program) & |
21:15:48 | dadada | run it in a subshell |
21:16:00 | leorize | don't abuse the shell please |
21:16:03 | leorize | it's not portable |
21:16:25 | leorize | dadada: do you have a bug report and/or sample code? |
21:16:37 | dadada | leorize: yeah, I'm making sample code now |
21:18:09 | xace | leorize: the problem with startprocess is that i have to close the process afterwards... |
21:19:17 | leorize | you can just not do that :P |
21:19:28 | xace | so it wont mess things up? |
21:19:44 | leorize | other than leaking a bit of memory? yea |
21:20:14 | xace | well my nim program will not live longer than 1 second... or are you referring to the os level? |
21:20:29 | leorize | nah, just your nim program |
21:22:01 | leorize | xace: also see poDaemon |
21:22:31 | leorize | so {poDaemon, poParentStreams} |
21:22:38 | leorize | then the leakage will be none |
21:22:54 | dadada | leorize: https://play.nim-lang.org/#ix=2lGO |
21:23:14 | dadada | it works on playground, because you need to put the sample ref into a separate module and import for the error to be triggered |
21:23:40 | dadada | oops, I commented the import out, you need to reverse that of course |
21:23:44 | xace | leorize: well now i have to look up the manual to understand that... :( i just want a simple run_executable() also i want to silence the program.... |
21:23:44 | * | titanomachy joined #nim |
21:24:18 | leorize | then you'll have to wait until I'm done with my process library :P |
21:24:43 | leorize | dadada: this bug looks familiar |
21:25:11 | leorize | try renaming the sample module into something that's not sample |
21:25:18 | xace | lol been tempted to write it myself for the past year, but something always comes up |
21:25:41 | dadada | leorize: the name was originally sampleTree ... ? seriously a bug based on the name of the module??! |
21:25:47 | dadada | and that also didn't work |
21:26:20 | leorize | it works for me |
21:26:34 | leorize | I just renamed sample.nim into samplet.nim |
21:26:46 | leorize | this bug is due to faulty symbol binding |
21:26:58 | dadada | and why didn't it work when my module was named sampletree.nim ? |
21:27:02 | FromDiscord | <exelotl> alexander92: ah my problem was unrelated, my `view` macro was fine but I was also using `staticRead` somewhere else that wasn't allowed |
21:27:07 | xace | geez, does startprocess() need the full path to the executable? |
21:27:19 | leorize | dadada: remember how `import module` let you do `module.thisProc`? |
21:27:28 | skrylar[m] | dadada: yep those can happen. if a module is named foo and has a type Foo it will also explode |
21:27:40 | leorize | yea, this is the case where the `module` symbol was binded instead of the type... |
21:27:44 | leorize | I thought we fixed this |
21:27:47 | leorize | xace: poUsePath |
21:28:01 | skrylar[m] | leorize: not in 1.2.0 :b |
21:28:05 | dadada | that's soo stupid!, oh man, sorry, that's just disappointing |
21:28:23 | leorize | dadada: make your types have the first letter uppercase |
21:28:35 | leorize | skrylar[m]: I thought we got this out before 1.0 even lol |
21:29:35 | dadada | leorize: yep, the fix works |
21:29:49 | dadada | still, this is a showstopper bug... how can nim be this stupid |
21:29:51 | Prestige | Not seeing anything in the manual about this - is there a built-in proc to get the index of an item in an array/seq? |
21:30:05 | Prestige | I've just been using my own proc `indexOf` |
21:30:19 | dadada | leorize: thanks! |
21:31:02 | leorize | Prestige: `find` |
21:33:01 | * | titanomachy quit (Quit: Titano quit.) |
21:33:24 | leorize | dadada: can you file an issue? |
21:33:27 | * | abm quit (Read error: Connection reset by peer) |
21:33:30 | Prestige | Thanks |
21:33:35 | dadada | leorize: yes, I'll file |
21:33:52 | * | abm joined #nim |
21:33:54 | leorize | I thought we already tackled this, but now I can't find the exact issue anymore :/ |
21:34:44 | xace | discard startProcess(&"simple_program '{file}' &> /dev/null", options = {poDaemon, poEvalCommand, poUsePath}) # geez, will the stdlib ever add a easier function? run_disown or something? |
21:35:12 | leorize | lol if you use poEvalCommand, use execCmdEx |
21:35:21 | leorize | it does exactly what you want |
21:35:30 | leorize | I just don't want you to have to touch the shell |
21:35:36 | leorize | but that'd have to wait I guess |
21:36:37 | xace | leorize: yeah, but execcmdex requires me to wait for the prcess to finish |
21:37:38 | dadada | leorize: https://github.com/nim-lang/Nim/issues/14310 is this issue written good enough?= |
21:37:43 | leorize | xace: ah, true |
21:37:54 | xace | also poevalcommand waas neccessary to silence the stdout, stderr. because then i have to use poinherintparentstreams and that would be another annoyance |
21:38:36 | xace | you have to wait until the program spawns until your nim program closes... so much work for something so simple :( |
21:38:50 | leorize | put poParentStreams in too |
21:39:08 | leorize | or else nim will allocates two 3 pipes for the child process |
21:39:48 | xace | the line just got longer |
21:39:59 | alexander92 | exelotl <3 ok |
21:40:05 | dadada | leorize: written well enough? |
21:40:59 | leorize | usually you should use the issue template... |
21:41:15 | FromDiscord | <exelotl> 1 line templating engine for jester :D |
21:41:18 | FromDiscord | <exelotl> macro view(str: static[string]): string = newCall("fmt", newLit(staticRead(str))) |
21:45:54 | FromDiscord | <Technisha Circuit> What's a good websocket library for Nim? |
21:46:03 | FromDiscord | <Technisha Circuit> And how would i get a python-like class system? |
21:46:08 | FromDiscord | <Technisha Circuit> With an init function |
21:46:15 | FromDiscord | <Technisha Circuit> Because man i can't leave Python |
21:46:31 | leorize | then you shouldn't use Nim :) |
21:46:54 | * | exelotl quit (Ping timeout: 240 seconds) |
21:46:58 | leorize | seriously, if you wanna use Nim to the fullest, you gotta embrace all of it |
21:47:10 | FromDiscord | <Technisha Circuit> True ;-; |
21:47:21 | leorize | because Nim just looks like python, it's not python in any other way |
21:47:27 | FromDiscord | <Technisha Circuit> But how would i make a class system then? |
21:47:32 | FromDiscord | <Technisha Circuit> ;-; |
21:47:37 | leorize | you don't |
21:47:59 | * | tane quit (Quit: Leaving) |
21:48:00 | leorize | I mean you can but I'd advise strongly against it |
21:48:18 | FromGitter | <kaushalmodi> I can speak for myself: I got into Nim because it had most of the things I needed, and then for the stuff it didn't, I was able to relatively easily contribute to it (compared to other languages) |
21:48:33 | leorize | also for a websockets library the only one around is `websockets` <- that's a nimble package |
21:48:49 | FromGitter | <kaushalmodi> Technisha Circuit: You need to start with a fresh approach on how Nim is designed to work |
21:48:59 | FromDiscord | <exelotl> is there a particular feature you want or is it just the "look and feel" of having a constructor and fields and stuff under 1 roof? |
21:49:02 | FromGitter | <kaushalmodi> you will be miserable if you try to make it work like Python |
21:49:27 | FromDiscord | <Technisha Circuit> Thanks and okay ;-; |
21:50:51 | leorize | Technisha Circuit: you can refer to @KingDarBoja |
21:51:03 | leorize | oh wait I can't ping discord here |
21:52:19 | leorize | we actually have a lot of former python users here |
21:52:51 | leorize | and to make you feel better, most of them tried to make nim work like python the first two weeks writing nim :P |
21:54:05 | FromDiscord | <Never Listen To Beef> It's the same thing for any programmer from a different language, they want the old and then they realize the new is cooler 😄 |
21:55:09 | krux02 | dadada: If you care about it. I am working on my own compiler fork by now. But I didn't get into fixing a single bug yet. All I did so far was refactoring and throwing out experimental features. |
21:55:29 | krux02 | and merging my old unmerged pull requests. |
21:55:36 | FromDiscord | <Technisha Circuit> Oof |
21:55:57 | FromDiscord | <Never Listen To Beef> I mean my first bit of time in nim i was attempting to do OOP and C# things |
21:56:29 | FromDiscord | <Technisha Circuit> Hahaha |
21:57:05 | FromDiscord | <Technisha Circuit> Well, if i wanted to make a discord lib, and I'm unable to use classes, how would it be structured? |
21:57:19 | FromDiscord | <Technisha Circuit> Keep in mind I'm planning on making the lib usable in Python too |
21:57:48 | FromDiscord | <Never Listen To Beef> What do you mean how would it be structured? |
21:58:39 | FromDiscord | <Technisha Circuit> How would it just work generally without classes? |
21:59:01 | FromDiscord | <Never Listen To Beef> Using events, and Value type objects |
21:59:04 | FromDiscord | <Technisha Circuit> In classes i am able to use `self` or `this` as it's more commonly known as |
21:59:16 | FromDiscord | <Technisha Circuit> Could you tell me how those work? 😅 |
21:59:23 | FromGitter | <kaushalmodi> Technisha Circuit: You probably don't yet know of proc overloading in Nim |
21:59:41 | FromGitter | <kaushalmodi> I'd recommend going through https://narimiran.github.io/nim-basics/ |
21:59:55 | leorize | also learn object variants |
22:00:01 | FromGitter | <kaushalmodi> also https://nim-lang.org/learn.html |
22:00:18 | leorize | usually variants can replace most class systems |
22:00:27 | FromGitter | <kaushalmodi> > Keep in mind I'm planning on making the lib usable in Python too ⏎ ⏎ You just compile the Nim project to a .so/.dll and load that in Python |
22:00:43 | FromDiscord | <Technisha Circuit> Thanks! |
22:02:01 | FromGitter | <kaushalmodi> Technisha Circuit: Someone in my Mastodon feed posted this regarding Nim .so loading in Python: https://mastodon.in.th/@sirn/104110103788846643 |
22:03:32 | FromDiscord | <Never Listen To Beef> Am i just dumb, i've only ever seen operator overloading, what is proc overloading? |
22:05:17 | leorize | proc overloading means that you can have a procedure of the same name that takes different parameters |
22:05:32 | FromDiscord | <Never Listen To Beef> Ah ok so i did know of it just didnt expect it in that context |
22:06:15 | FromDiscord | <Never Listen To Beef> I guess it's also called overloading in C# but i rarely do it |
22:06:16 | FromDiscord | <Never Listen To Beef> Im dumb |
22:06:50 | dadada | are people that worked on the vscode extension in this channel? |
22:09:17 | * | Cthalupa quit (Ping timeout: 260 seconds) |
22:09:31 | FromGitter | <kaushalmodi> Never Listen To Beef: I think I learned of the "function overloading" term from my C++ classes in undergrad.. never touched C++ after that |
22:10:51 | FromDiscord | <Never Listen To Beef> Yea "method overloading" in C#, but in this case i think i just shut the murmurs of my C# brain since most of that knowledge is useless in nim 😛 |
22:11:18 | * | Cthalupa joined #nim |
22:11:29 | leorize | some programming concepts are pretty universal |
22:12:55 | FromDiscord | <Never Listen To Beef> Apparently so |
22:13:12 | * | abm quit (Quit: Leaving) |
22:17:14 | * | Cthalupa quit (Ping timeout: 240 seconds) |
22:17:20 | * | lmariscal quit (Quit: I'm Out!) |
22:17:43 | * | lmariscal joined #nim |
22:17:53 | * | Cthalupa joined #nim |
22:27:44 | FromDiscord | <Doongjohn> https://play.nim-lang.org/#ix=1ZTy is this a bug? this code is from the doc |
22:31:14 | * | thomasross joined #nim |
22:31:44 | leorize | not sure |
22:33:13 | * | zacharycarter quit (Ping timeout: 264 seconds) |
22:34:15 | * | Zunaka quit (Quit: Some folks are wise, and some otherwise.) |
22:54:17 | * | chemist69 quit (Ping timeout: 244 seconds) |
22:54:35 | * | Trustable quit (Remote host closed the connection) |
22:55:15 | * | chemist69 joined #nim |
23:00:17 | * | zacharycarter joined #nim |
23:11:44 | FromDiscord | <KingDarBoja> leorize: did you pinged me? I saw the conversation with Technisha Circuit |
23:11:45 | FromDiscord | <KingDarBoja> 😄 |
23:11:55 | FromDiscord | <KingDarBoja> @Technisha Circuit sup bro |
23:13:07 | * | lritter quit (Quit: Leaving) |
23:13:50 | * | disbot quit (Ping timeout: 272 seconds) |
23:14:14 | * | disruptek quit (Ping timeout: 260 seconds) |
23:18:23 | * | disbot joined #nim |
23:18:43 | * | disruptek joined #nim |
23:21:00 | FromGitter | <kaushalmodi> I somehow think that Technisha is a sis |
23:22:46 | FromDiscord | <KingDarBoja> Doesn't matter to me |
23:34:43 | zacharycarter | stream is up https://www.twitch.tv/zachary_carter |
23:42:22 | zacharycarter | shashlick: looks like nimterop is generating `Bool`? |
23:44:51 | zacharycarter | nevermind looks like it was fixed in a new version |
23:48:10 | zacharycarter | also I don't think the ast change fixed my issue and nimterop seems way slower now |
23:48:26 | * | krux02 quit (Remote host closed the connection) |
23:49:49 | zacharycarter | my issue being that nimterop still doesn't handle type aliases correctly |
23:49:54 | zacharycarter | and I still have to cOverride them |
23:54:25 | * | voltist quit (Quit: Ping timeout (120 seconds)) |
23:54:43 | * | voltist joined #nim |
23:56:02 | FromGitter | <timotheecour> @kaushalmodi ya i’m here |
23:57:18 | shashlick | @zacharycarter do you use -f:ast2 |
23:57:29 | * | fredrikhr quit (Quit: Client Disconnecting) |
23:59:49 | * | ftsf joined #nim |