00:00:12 | FromDiscord | <KingDarBoja> Ofc, being developed by Microsoft... that's what you get |
00:00:21 | FromDiscord | <KingDarBoja> Like C# is Microsoft Java |
00:00:29 | audiophile | oh I see |
00:00:29 | krux02_ | that is how it started |
00:00:41 | audiophile | as long as it gets rid of the weak typing I'm cool with it haha |
00:00:43 | companion_cube | still much better than js |
00:00:49 | krux02_ | KingDarBoja: C# started as a Java fork. |
00:00:52 | FromDiscord | <KingDarBoja> Yeah, agreed |
00:00:55 | FromDiscord | <KingDarBoja> oh |
00:01:16 | krux02_ | Embrace Extend Exterminate, they tried with java, got sued, and then they had to call their fork C#. |
00:01:31 | FromDiscord | <KingDarBoja> Wait what |
00:01:48 | krux02_ | yes |
00:02:13 | krux02_ | they really wanted to dominate Java. |
00:03:24 | krux02_ | https://www.cnet.com/news/sun-microsoft-settle-java-suit/ |
00:03:44 | * | Tlongir joined #nim |
00:05:20 | krux02_ | > Though Microsoft may clone Java, it won't be allowed to say its products are Java-compatible. |
00:05:52 | * | krux02_ is now known as krux02 |
00:06:12 | FromDiscord | <KingDarBoja> Reading the article, hold on |
00:06:29 | * | FromDiscord <KingDarBoja> Then Sun's lawsuit froze Microsoft's plans to modify Java for its own benefit, and Java became established in the meantime. |
00:09:28 | FromDiscord | <KingDarBoja> Well, although Java phrase is "Code Once, Run Everywhere", since Sun got bought by Oracle, the language has been more limited to the public on every new version |
00:14:18 | Yardanico | oh nice not everyone's asleep :P |
00:14:35 | Prestige | o/ |
00:16:16 | FromDiscord | <KingDarBoja> π |
00:18:17 | Yardanico | time to continue reading this craftinginterpreters book, so far most of the stuff is not new for me (like recursive-descent parsing, lexing, etc), although scoping stuff is interesting |
00:18:35 | Yardanico | also it's additional excersise to translate Java to Nim as you read the book :P |
00:18:51 | Prestige | Yardanico: learning for fun? |
00:18:51 | audiophile | are you interested in compilers? |
00:18:57 | audiophile | compilers is the only course I nearly flukned |
00:19:00 | audiophile | *flunked |
00:19:11 | Yardanico | Prestige: yeah, why not |
00:19:28 | Yardanico | maybe I'll make my own best (TM) language /s |
00:19:32 | FromDiscord | <KingDarBoja> https://www.reddit.com/r/java/comments/a0ngus/explain_the_java_no_longer_free_for_commercial/ |
00:19:41 | * | hoffentlichja quit (Ping timeout: 256 seconds) |
00:19:52 | Prestige | I'd love to work on a language, even if it were just to learn |
00:19:55 | audiophile | relevant xkcd https://xkcd.com/927/ |
00:20:05 | Yardanico | so far the most surprising thing is that I'm really just using a few nim std modules |
00:20:20 | Prestige | I've never gotten into anything very low level before though |
00:20:39 | Yardanico | tables for the environment (scoping), strformat for formatting a few error messages, "os" for reading files, strutils for some string stuff |
00:21:20 | Yardanico | but I'm still not in the end of the first part of the book where all fun (functions, classes, etc) happens |
00:21:29 | audiophile | wait what book |
00:21:35 | Yardanico | audiophile: http://www.craftinginterpreters.com/ |
00:21:53 | audiophile | oh nice thanks! |
00:22:01 | audiophile | is it good for those new to this? |
00:22:09 | Yardanico | in the book you basically write two interpreters for the same language Lox, first one in Java (I'm doing it in Nim instead), second in C (I'm not sure which one to choose yet though) |
00:22:26 | audiophile | ohh |
00:22:42 | audiophile | are you open sourcing your code by any chance |
00:22:45 | Yardanico | yes |
00:22:49 | audiophile | ok :) |
00:23:14 | Yardanico | I only had a bit of experience with recursive descent before reading the book (https://github.com/Yardanico/nim-mathexpr/), but it's quite interesting |
00:23:28 | FromDiscord | <KingDarBoja> β€οΈ Dart |
00:23:35 | audiophile | so this book might give you more ideas for your nimexpr |
00:23:41 | FromDiscord | <KingDarBoja> Like the Google TypeScript but without JS cons |
00:24:00 | Yardanico | My source is in https://github.com/Yardanico/nim-lox , there is also https://github.com/cabhishek/nimlox but I don't look into it because I want my own implementation :) |
00:24:12 | * | Tyresc quit (Quit: WeeChat 2.9-dev) |
00:24:12 | Yardanico | you might compare them both but mine's not complete yet since I only completed chapter 8 |
00:24:22 | audiophile | ah that's ok! |
00:24:33 | audiophile | I star your repo because I will follow closely >_> |
00:25:05 | audiophile | why interpreter? because it is easier than writing a compiled language? |
00:25:14 | FromDiscord | <KingDarBoja> I did the same cuz I like Yard |
00:25:17 | Yardanico | audiophile: well kinda yeah |
00:25:28 | audiophile | ah ok |
00:25:39 | audiophile | but it should still help understand what makes nim tick right? |
00:25:42 | audiophile | at least to some extent |
00:25:46 | Yardanico | yeah |
00:25:48 | Yardanico | AST and stuff |
00:25:50 | audiophile | NICE |
00:26:01 | Yardanico | although later in the book you implement a bytecode compiler and a VM |
00:26:02 | audiophile | I've been emailing senior devs around asking for help on how to approach this |
00:26:10 | audiophile | VM meaning something like the jvm? |
00:26:10 | audiophile | kinda |
00:26:18 | Yardanico | audiophile: well, not that advanced |
00:26:22 | Yardanico | more like in CPython |
00:26:22 | audiophile | kinda :) |
00:26:25 | audiophile | oh :( |
00:26:31 | Yardanico | or NimScript I guess |
00:26:44 | Yardanico | nim compiler has an embedded VM too |
00:26:49 | Yardanico | for running nim at compile-time |
00:27:02 | audiophile | I'm a bit fuzzy on compiling etc so I'm lost here ? |
00:27:32 | * | FromDiscord <KingDarBoja> I get lost everytime after reading some comments |
00:27:58 | companion_cube | how do I make an openArray from a `ptr T` and a length? |
00:28:13 | Yardanico | companion_cube: openarray is not a concrete type |
00:28:49 | Yardanico | meaning you can't create variables of this type |
00:28:59 | * | ZoomZoomZoom quit (Read error: Connection reset by peer) |
00:29:08 | companion_cube | oh, it's only for arguments? ok |
00:29:09 | Yardanico | it's meant to be used when you want some routine to accept different container types like seqs/strings/arrays |
00:29:20 | companion_cube | I actually just want to print the pointer's content |
00:29:23 | companion_cube | for debug purpose |
00:29:30 | Yardanico | well you can cast it to UncheckedArray |
00:29:50 | companion_cube | how do I set the length though? |
00:30:37 | Yardanico | you don't :P |
00:30:50 | audiophile | what you mean by concrete type |
00:30:51 | audiophile | builtin/ |
00:30:52 | audiophile | ? |
00:31:12 | companion_cube | Yardanico: so that doesn't help me putting my ptr+len into a `fmt"β¦"` :D |
00:31:26 | Yardanico | companion_cube: you can cast to UncheckedArray and make a seq out of it |
00:31:41 | Yardanico | like for i in 0..<mylen: myseq[i] = myunchedkarray[i] |
00:32:02 | Yardanico | audiophile: for some info on that there's https://en.wikipedia.org/wiki/Abstract_type |
00:32:13 | companion_cube | ugh, that allocates and stuff :D |
00:32:19 | Yardanico | I can't really explain since I don't know a lot about this topic, but I kinda can understand in my head the difference between the two :P |
00:32:33 | audiophile | I think I've come across abstract in oop in java |
00:32:41 | FromDiscord | <KingDarBoja> I do |
00:33:14 | FromDiscord | <KingDarBoja> But I prefer a image to explain this |
00:34:06 | Prestige | Attempting to create my own type/object, is there a way to initialize one of its members without it being passed in as a constructor argument? |
00:34:27 | audiophile | whats an equivalent to turtle library from python? for drawing lines etc |
00:34:59 | * | inv2004 quit (Read error: Connection reset by peer) |
00:34:59 | FromDiscord | <KingDarBoja> You could init that on the constructor body |
00:35:22 | FromDiscord | <KingDarBoja> OMG my internet is trash again |
00:35:53 | Yardanico | Prestige: if you mean default fields in type type itself, that's not (yet) there |
00:36:06 | Yardanico | but you can just create (and it's better to) a constructor for your type |
00:36:11 | zacharycarter | Got hot reloading working via a plugin system and `--gc:arc`: https://github.com/zacharycarter/junkers - still lots of testing to do but so far looks promising |
00:36:17 | Yardanico | btw the convention is initType for "object" types and newObject for "ref object" |
00:36:18 | Prestige | I meant a new type, I guess I just haven't ran into docs about contructors yet |
00:36:28 | Yardanico | Prestige: constructors are just ordinary procs |
00:36:29 | FromDiscord | <KingDarBoja> +1 for Yard tip |
00:36:46 | Yardanico | like I have |
00:36:47 | Yardanico | proc newParser*(tokens: seq[Token]): Parser = Parser(tokens: tokens) |
00:36:47 | Prestige | oh so I'd just create a proc with w/e name to initialize the object? |
00:36:53 | Prestige | okay, cool thanks |
00:45:16 | audiophile | guise where/how do i learn metaprogramming, macros? |
00:48:25 | * | FromDiscord <KingDarBoja> To learn how to macro, you must become a macro |
00:50:53 | * | rmnull joined #nim |
00:50:53 | FromGitter | <matrixbot> `nerdrat` Hello everyone today I updated nim with `choosenim update stable`. However after creating a project with `nimble init` I try to build the binary with `nimble build` but stops trowing the following error: β β ```$ nim c -d:danger koch.nim β $ ./koch --latest nimble``` β β But it didn't solved the problem. [https://gitter.im/nim-lang/Nim?at=5e98fd6d2ff88975b425ec8c] |
00:51:48 | leorize[m] | @nerdrat: join us here on IRC at #freenode_#nim:matrix.org |
00:52:17 | * | nerdrat[m] joined #nim |
00:52:34 | leorize[m] | what version of choosenim are you on? |
00:53:30 | nerdrat[m] | <leorize[m] "what version of choosenim are yo"> Latest, I did `choosenim update self` first. |
00:54:06 | nerdrat[m] | I think is `v0.6.0` |
00:54:18 | leorize[m] | what does `nim --version` give you? |
00:55:01 | nerdrat[m] | <leorize[m] "what does `nim --version` give y"> ``` |
00:55:16 | Yardanico | nerdrat[m]: it got stripped in IRC |
00:55:27 | Yardanico | we can't see :P just tell the version and (possibly) the hash |
00:55:50 | leorize[m] | please don't use the reply function in matrix |
00:56:02 | leorize[m] | the IRC way is to just mention people |
00:56:18 | nerdrat[m] | Ok it is 1.2.0 leorize[m] |
00:56:24 | * | hoffentlichja joined #nim |
00:56:33 | leorize[m] | hmm, you're on the latest |
00:56:36 | leorize[m] | what's your nimble version? |
00:56:44 | leorize[m] | `nimble --version` |
00:57:11 | nerdrat[m] | v0.11.0 |
00:58:27 | leorize[m] | ping dom96, shashlick |
00:58:31 | nerdrat[m] | I also cleaned the cache leorize[m]. |
01:00:24 | leorize[m] | I've no idea why it doesn't work then, hopefully the choosenim authors I pinged will have some ideas |
01:01:47 | nerdrat[m] | The issue in github is closed, I don't know what else can I do. leorize[m] |
01:02:09 | leorize[m] | you don't have to ping me for every message :P |
01:02:18 | leorize[m] | can you link the issue here? |
01:02:31 | nerdrat[m] | Sorry |
01:02:55 | nerdrat[m] | https://github.com/nim-lang/nimble/issues/693 |
01:02:57 | disbot_ | β₯ Document how to recover from corrupted nimble cache ; snippet at 12https://play.nim-lang.org/#ix=2ilH |
01:05:40 | leorize[m] | can you try to compile a file with just `import strformat`? |
01:05:56 | * | chemist69_ joined #nim |
01:08:32 | nerdrat[m] | It gives me the same error using `nim c -r myproject.nim` |
01:08:32 | nerdrat[m] | `Error: cannot open file: strformat` |
01:08:59 | * | chemist69 quit (Ping timeout: 256 seconds) |
01:09:01 | leorize[m] | looks like your nim installation is botched |
01:09:16 | leorize[m] | can I have the output of `nim dump`? |
01:10:27 | * | nerdrat[m] sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/RNfVdGGYhxGuCmjNvSrATznx > |
01:11:12 | leorize | try reinstalling nim then |
01:11:29 | leorize | your nim installation seems to be corrupted |
01:11:34 | disruptek | nimph includes a working choosenim, fwiw. |
01:11:38 | disruptek | !repo nimph |
01:11:38 | disbot_ | https://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future π§ 15 59β 4π΄ 7& 1 more... |
01:13:21 | nerdrat[m] | I simply delete the `.choosenim/toolchains/nim-1.2.0/` or how can I reinstall nim with choosenim? |
01:13:35 | leorize | `choosenim stable`? |
01:13:40 | leorize | I'm not sure, I don't use choosenim |
01:15:38 | nerdrat[m] | Dammit! I'll select another toolchain that works and then I'll delete the toolchain directory of nim-1.2.0. |
01:16:53 | nerdrat[m] | I hope this doesn't break anything else |
01:18:27 | * | ryan_ joined #nim |
01:19:32 | disruptek | what is choosenim buying you, here? |
01:19:51 | shashlick | Common disruptek, not this again |
01:20:02 | disruptek | what? |
01:20:30 | disruptek | you think i put this user up to this? |
01:20:34 | * | Tlongir quit (Ping timeout: 240 seconds) |
01:21:17 | shashlick | Quit your bashing |
01:21:37 | disruptek | quit trying to justify poor software behavior. |
01:22:00 | disruptek | oh, actually you aren't doing so. or helping the user. my bad. |
01:22:03 | * | lritter quit (Ping timeout: 250 seconds) |
01:22:05 | shashlick | Gosh, way to inspire |
01:22:24 | disruptek | i agree. i'm tired of merely accepting the status quo. |
01:22:51 | disruptek | i wish you were, too. |
01:23:04 | * | lritter joined #nim |
01:23:27 | shashlick | nerdrat: agree with leorize, would have helped to see contents of the lib directory |
01:24:29 | shashlick | Seems like an extraction issue of some sort with nimarchive |
01:32:49 | * | krux02 quit (Ping timeout: 252 seconds) |
01:33:17 | FromDiscord | <Zed> this may get a biased answer, but how do you guys find nim against crystal?, im wanting to learn one or the other |
01:33:22 | * | hoffentl1chja joined #nim |
01:33:51 | disruptek | depends on what you want to write. |
01:34:03 | nerdrat[m] | Crystal is a bloated ruby copy |
01:34:09 | * | krux02 joined #nim |
01:34:17 | * | hoffentl1chja left #nim (#nim) |
01:34:17 | FromDiscord | <Zed> more embedded things, raspberry pi etc.. |
01:34:39 | FromDiscord | <Zed> why do you say that? |
01:35:16 | disruptek | i don't really think crystal is comparable for that. |
01:35:35 | * | hoffentlichja quit (Disconnected by services) |
01:35:53 | leorize[m] | crystal leans a bit further on the application programming spectrum than we do |
01:36:55 | nerdrat[m] | leorize[m]: Reinstalling nim-1.2.0 didn't work |
01:36:57 | disruptek | i'm trying to think of anyone in the nim community that writes crystal, but i'm drawing a blank. |
01:37:35 | FromDiscord | <Zed> lol, what would say nim is best used for? |
01:37:49 | FromDiscord | <Varriount> leorize: I like to think Nim is suitable for application development too |
01:37:51 | shashlick | nerdrat: can you check the lib directory for contents |
01:39:06 | nerdrat[m] | I checked `strformat.nim` is where it should be. |
01:39:39 | nerdrat[m] | inside the `pure` directory |
01:39:49 | shashlick | does it have anything in it |
01:40:17 | shashlick | well, the error says file not found so hm |
01:40:30 | shashlick | can you zip the entire folder and post it somewhere |
01:41:14 | disruptek | nim is like a more elegant python that is hugely performant and has the chops to compete with lisp in terms of abstraction. |
01:41:17 | nerdrat[m] | yes 713 lines of nim code |
01:41:33 | FromDiscord | <KingDarBoja> Hold my beer |
01:41:41 | disruptek | i think crystal is a supercharged ruby. if ruby is what you want, crystal lets you make it run faster. |
01:42:00 | zacharycarter | does crystal have windows support yet? |
01:42:08 | FromDiscord | <Zed> nope |
01:42:08 | disruptek | it has no place in my toolbox, so i can't speak on it much. no, no windows support afaik. |
01:42:22 | zacharycarter | yeah - still not interested in it then |
01:42:22 | * | naught-fowl quit (Remote host closed the connection) |
01:42:30 | FromDiscord | <Zed> the only way you can get windows support is if you run a linux subsystem |
01:42:32 | zacharycarter | probably won't be when it does |
01:42:35 | shashlick | also can you zip the ~/.choosenim folder (without toolchains) |
01:42:50 | zacharycarter | I like Nim - and Nim is getting better afiact |
01:42:57 | zacharycarter | afaict |
01:42:57 | FromDiscord | <KingDarBoja> No windows = Not my interest |
01:42:58 | shashlick | presuming you are on linux |
01:43:11 | FromDiscord | <Zed> crystal seems to have more libraries for it then nim does |
01:43:29 | disruptek | you have to understand that nim boils down to really simple C that can be compiled and run anywhere, very quickly. simple C that is infinitely portable and offers little undefined behavior. |
01:43:31 | zacharycarter | yeah but extending Nim's ecosystem is simple |
01:43:38 | zacharycarter | just find a comparable C/C++ library and write bindings to it |
01:44:01 | disruptek | does crystal compile to javascript? |
01:44:03 | Yardanico | disruptek: well crystal uses LLVM and LLVM isn't exactly bad at portability between popular OSes |
01:44:21 | * | hoffentlichja joined #nim |
01:44:27 | zacharycarter | Windows is pretty popular |
01:44:31 | zacharycarter | and Nim has nlvm |
01:44:34 | Yardanico | Zig works on most major OSes which support LLVM fwiw |
01:44:48 | Yardanico | linux, macos, windows, freebsd, netbsd, and probably others if you can compile llvm on them |
01:44:50 | disruptek | i think my dad uses windows. it's blue, right? |
01:44:52 | zacharycarter | yeah but Zig is extremely immature and doesn't have async or netcode yet |
01:44:59 | Yardanico | zacharycarter: it does have async though |
01:45:06 | zacharycarter | a preliminary release of it |
01:45:15 | FromDiscord | <Zed> I think V is a better zig |
01:45:20 | Yardanico | no |
01:45:23 | zacharycarter | I think V is vaporware |
01:45:25 | disruptek | lol |
01:45:28 | Yardanico | pls don't bring V into discussion |
01:45:32 | Yardanico | disruptek: btw glad to see you back :P |
01:45:36 | disruptek | zig is a legit v, maybe. |
01:45:37 | FromDiscord | <Zed> why not? |
01:45:40 | disruptek | Yardanico: o7 |
01:45:45 | Yardanico | because V is overhyped |
01:45:54 | zacharycarter | because the V author makes bold claims that never end up being accurate |
01:46:01 | disruptek | it's nothing. |
01:46:07 | disruptek | no rule. |
01:46:09 | Yardanico | also V is a good example of why github stars are useless |
01:46:10 | disruptek | no role, rather. |
01:46:30 | zacharycarter | If you want to compare all these languages - my suggestion - try to build something with them |
01:46:38 | zacharycarter | then you'll have something to back your speculation |
01:46:50 | disruptek | good advice. |
01:46:57 | zacharycarter | I've tried doing what I do with Nim with Zig and I hit major roadblocks |
01:47:04 | FromDiscord | <Zed> what would your default project be? |
01:47:10 | zacharycarter | I can't use Crystal because there's no windows support |
01:47:20 | Yardanico | well yeah I know Zig stdlib is really undocumented and there's no real network facilities yet |
01:47:23 | zacharycarter | a game that doesn't use SDL2 |
01:48:20 | zacharycarter | for instance, with Nim I have this working right now - https://imgur.com/a/ExIVYLm |
01:48:26 | disruptek | i wrote a crossword solver as my first nim project. |
01:48:32 | FromDiscord | <Chiqqum_Ngbata> I began working on a project in nim and was doing this sort of comparison myself. Zig was appealing until I realized it wasn't at all documented (it is now but at the time it wasn't) |
01:49:03 | zacharycarter | doesn't look like much but I'm using sokol_app, sokol_gfx, cr (For hot reloading plugins) and physfs |
01:49:10 | Yardanico | yeah I tried writing some simple stuff with zig |
01:49:42 | Yardanico | https://github.com/Yardanico/zig-osureplay and a version of my recursive-descent math evaluator (it got lost when I cleaned my home partition though) |
01:50:14 | Yardanico | I like cross-compilation in Zig so you don't have to build the cross-compilers yourself :P and you can already use it with nim |
01:50:36 | FromDiscord | <Chiqqum_Ngbata> Nim probably fits (personal opinion) a similar niche as Python; good for glue code, super readable, but obviously performs much better out of the box. Much more mature than Zig |
01:50:42 | Yardanico | yeah |
01:50:52 | Yardanico | Nim is the sweet spot between performance and code readability ;) |
01:51:15 | disruptek | i don't zig ever achieving the abstractions we can with nim's metaprogramming, though. |
01:51:21 | disruptek | it's a better C, sure. |
01:51:22 | Yardanico | yeah, Zig is against all that |
01:51:27 | disruptek | but we don't need another C. |
01:51:36 | Yardanico | Zig's main goal is to be as explicit as possible :P |
01:51:38 | FromDiscord | <Chiqqum_Ngbata> I've enjoyed Nim in general. Some parts have felt hostile but I actually have a theory that weird warts is probably a good sign that there is less aversion to experimenting, and is ultimately a good thing |
01:51:41 | zacharycarter | you can avoid cross compilation with Nim using nlvm too |
01:51:42 | Yardanico | "There is no hidden control flow, no hidden memory allocations, no preprocessor, and no macros. " |
01:52:12 | Yardanico | zacharycarter: well but Zig just acts as a C compiler (it bundles clang) |
01:52:19 | Yardanico | also it's a pretty small download for what it has |
01:52:27 | Yardanico | well, not clang, but libclang |
01:52:39 | FromDiscord | <KingDarBoja> https://www.slant.co/versus/395/5522/~nim_vs_rust Random comparison link |
01:52:42 | disruptek | pretty heavy though, when you think about it. |
01:52:54 | FromDiscord | <KingDarBoja> Oops, wrong link |
01:52:57 | Yardanico | @KingDarBoja see https://www.slant.co/topics/6032/~systems-programming-languages btw |
01:53:17 | disruptek | just ask yourself what these languages are going to be doing in 10 years. |
01:53:18 | FromDiscord | <KingDarBoja> Thank you π |
01:53:22 | FromDiscord | <Zed> nims at the top with the big boys |
01:53:26 | FromDiscord | <Zed> that's good |
01:53:54 | Yardanico | yeah I added quite a lot of pros a few years ago :D |
01:54:03 | Yardanico | "Tiberium" there is me |
01:54:08 | FromDiscord | <Chiqqum_Ngbata> Unfortunately I don't really see a clear path to adoption for Zig. Rust serves basically the same niche, has significant features Zig doesn't, and Zig isn't radically simpler--common Rust complaint |
01:54:25 | FromDiscord | <KingDarBoja> _No big name backer_ as cons |
01:55:07 | Yardanico | yeah ikr |
01:55:26 | FromDiscord | <KingDarBoja> Oh boy, there is Elixir |
01:55:47 | FromDiscord | <KingDarBoja> π But I find the lack of distinction between the "system" programming category distrubing |
01:55:52 | Yardanico | yeah |
01:56:44 | FromDiscord | <Zed> what about micro python? |
01:56:52 | Yardanico | what about it? |
01:56:57 | FromDiscord | <Zed> or is that basically nim but worse |
01:57:02 | FromDiscord | <KingDarBoja> I didn't expected Golang to be really focused on system |
01:57:08 | leorize | python is always nim but worse :P |
01:57:08 | Yardanico | that's entirely different from nim |
01:57:14 | FromDiscord | <KingDarBoja> As I pretty much heard it being used mostly for backend stuff |
01:57:16 | Yardanico | micropython is python for microcontrollers |
01:57:26 | FromDiscord | <KingDarBoja> Whereas Rust is the big one for embedding and stuff like that |
01:57:27 | Yardanico | and it's not the best option if you want your microcontrollers to be fast :P |
01:57:56 | FromDiscord | <KingDarBoja> Python is the big one besides Javascript for most stuff nowadays |
01:58:10 | FromDiscord | <KingDarBoja> As again, the syntax and the HUGE community and libraries has made it so popular |
01:58:24 | leorize | IMO languages with fibers kinda restricted themselves from approaching low-level |
01:58:26 | FromDiscord | <KingDarBoja> But ofc doesn't mean it is the best |
01:58:31 | FromDiscord | <Zed> i see go mentioned alot |
01:58:51 | FromDiscord | <KingDarBoja> And where is my boy Dart |
01:58:55 | FromDiscord | <KingDarBoja> π |
01:59:06 | leorize | Dart is DOA |
01:59:11 | FromDiscord | <KingDarBoja> DOA? |
01:59:23 | leorize | google is desperately trying to keep it afloat with Flutter |
01:59:30 | leorize | dead-on-arrival |
01:59:34 | FromDiscord | <KingDarBoja> Ahhh |
01:59:43 | FromDiscord | <KingDarBoja> Well Flutter seems very comfortable to work on |
01:59:53 | FromDiscord | <KingDarBoja> Too bad it is only mobile mostly |
02:00:03 | FromDiscord | <Chiqqum_Ngbata> I think Flutter has a chance. It will become much more appealing if Fuschia sees daylight |
02:00:05 | FromDiscord | <KingDarBoja> But I find Dart like the TypeScript-brother |
02:00:52 | shashlick | nerdrat[m]: just tried installing choosenim and running the strformat test 25 times locally in a loop, no luck reproducing the issue so anything you can share will be helpful |
02:01:27 | FromDiscord | <KingDarBoja> But hey |
02:01:34 | leorize | nerdrat[m]: can you post the full output of running `nim c thing/that/import/strformat.nim`? |
02:01:39 | FromDiscord | <KingDarBoja> Ruby has been on DOA if it were by ROR |
02:01:50 | FromDiscord | <Zed> why doesn't google just merger fuchisa and android? |
02:02:01 | FromDiscord | <Zed> *merge |
02:02:06 | leorize | they can't |
02:02:08 | FromDiscord | <KingDarBoja> Sounds easy, but doesn't |
02:02:25 | leorize | they are fundamentally different |
02:02:28 | leorize | actually they can |
02:02:53 | leorize | they're google, they have the resources to put things together |
02:03:07 | leorize | the blocker might just be that fuchisa is not ready yet |
02:03:13 | Yardanico | well yeah, but they started Fuchsia to have a platform they can have full control of :P |
02:03:27 | FromDiscord | <KingDarBoja> Well what about V? I remember the Odin author blaming its perfomance |
02:03:39 | Yardanico | a lot of false claims |
02:03:40 | leorize | V stands for vaporware |
02:03:54 | * | dddddd quit (Ping timeout: 240 seconds) |
02:04:02 | Yardanico | As I said before the only good V is https://github.com/belamenso/v |
02:04:06 | * | ryan_ is now known as number_one |
02:04:41 | FromDiscord | <KingDarBoja> WTF |
02:04:44 | Yardanico | ok gonna continue my interpreter , need to figure out how to add break statement :P |
02:04:58 | Yardanico | @KingDarBoja I've also made a fork of it https://github.com/Yardanico/nim-emojify |
02:05:12 | Yardanico | it uses different emojis instead of V |
02:05:16 | FromDiscord | <KingDarBoja> looool |
02:05:35 | Yardanico | took me a while to figure out how it works the first time I looked at the src tbh |
02:05:48 | FromDiscord | <KingDarBoja> https://github.com/vlang/v/issues/35 |
02:05:49 | FromDiscord | <Zed> https://www.emojicode.org/ |
02:05:50 | disbot_ | β₯ This language is not as advertised ; snippet at 12https://play.nim-lang.org/#ix=27la |
02:06:07 | Yardanico | @KingDarBoja well right now they try to fix things |
02:06:19 | Yardanico | like they actually have a proper AST now (they didn't until start of 2020 or something like that) |
02:06:29 | FromDiscord | <Zed> emojicode is the future guys |
02:06:32 | Yardanico | yes |
02:06:36 | Yardanico | time to write nim -> emojicode compiler |
02:06:40 | FromDiscord | <Zed> it's how the egyptians coded on their walls |
02:07:01 | Yardanico | and they funniest thing is that it's fast |
02:07:07 | Yardanico | written in C and compiles to native code with LLVM |
02:07:09 | FromDiscord | <KingDarBoja> I do rather let V evolve |
02:07:19 | FromDiscord | <KingDarBoja> As everything has its own peaks and falls |
02:07:30 | Yardanico | also see https://andrewkelley.me/post/why-donating-to-musl-libc-project.html about some V language drama |
02:07:36 | Yardanico | article by author of Zig |
02:07:38 | leorize | to be fair after their marketing stunt I don't really trust V anymore |
02:07:58 | leorize | not that I ever trusted their magical claims |
02:08:00 | FromDiscord | <Zed> V has a sponsor now as well |
02:08:10 | Yardanico | who |
02:08:13 | Yardanico | i'll find them' |
02:08:19 | FromDiscord | <KingDarBoja> The Doom Guy |
02:08:25 | FromDiscord | <Zed> https://www.mx.com/ |
02:08:31 | FromDiscord | <Zed> some finance company |
02:08:36 | leorize | V has more sponsors than Nim + Zig before it even release :) |
02:08:56 | FromDiscord | <Zed> it's actually a front |
02:09:05 | FromDiscord | <Zed> the company is also vaporware |
02:09:30 | Yardanico | leorize: well if Nim development started in 2015+ 4raq could've done the same hype thing :D |
02:09:32 | FromDiscord | <KingDarBoja> Idk but sponsors seems to be hard to earn as they will try to push things faster on the worst case (?) |
02:09:34 | FromDiscord | <Zed> pretend you have a sponsor to draw more sponsors in |
02:09:43 | Yardanico | big brain |
02:10:12 | FromDiscord | <Zed> well anybody can setup a website and a product, doesn't mean it's real |
02:10:16 | Yardanico | ah yeah I also remember how V author did twitter polls to decide on language syntax |
02:10:24 | leorize | Yardanico: well you can try to find the original marketing of Nim in the Lazarus forums |
02:10:34 | Yardanico | yeah I know it was like Pascal++ or something initially :P |
02:11:02 | Yardanico | and I also know the compiler was in object pascal |
02:12:08 | leorize | well let just say that the pascal people wasn't happy with Nim :P |
02:12:22 | leorize | 4raq said the forum only spread FUD about Nim |
02:12:28 | FromDiscord | <KingDarBoja> FUD? |
02:12:30 | Yardanico | wow http://nimrod-lang.org/ still works |
02:13:03 | Yardanico | "FUD is an acronym for fear, uncertainty and doubt. " |
02:13:18 | zacharycarter | https://github.com/vlang/v/issues/35 |
02:13:19 | disbot_ | β₯ This language is not as advertised ; snippet at 12https://play.nim-lang.org/#ix=27la |
02:13:36 | Yardanico | well yeah some of these are fixed but generally it's true |
02:13:57 | zacharycarter | yes |
02:15:00 | Yardanico | I guess it's time to make my own language called V++ XDDDD |
02:15:53 | Yardanico | also I wonder why would you ever release an UI lib for your language in GPLv3 https://github.com/vlang/ui |
02:16:08 | Yardanico | meaning that all apps which use it must be open-sourced |
02:16:30 | leorize | they are a FOSS advocate :P |
02:16:40 | zacharycarter | also lol at that UI lib's syntax |
02:16:47 | Yardanico | also what is this "verified" symbol https://github.com/vlang |
02:16:53 | Yardanico | can nim org get it too? :P ask github support pls |
02:16:54 | zacharycarter | or interface rather |
02:17:18 | Yardanico | https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/verifying-your-organizations-domain huh |
02:17:20 | zacharycarter | so much nesting |
02:17:54 | zacharycarter | that's about the only thing they can verify when it comes to vlang |
02:20:29 | Yardanico | probably the "best" thing is that the docs mention |
02:20:31 | Yardanico | "(Work in progress) There's no garbage collection or reference counting. V cleans everything up during compilation. If your V program compiles, it's guaranteed that it's going to be leak free." |
02:21:17 | disruptek | hey, it's only been a year. |
02:21:19 | disruptek | give them a break. |
02:21:32 | Yardanico | well anyway I wonder how they'll implement this memory management model |
02:21:39 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:21:47 | Yardanico | when they have raw pointers |
02:22:11 | disruptek | maybe they'll figure out how to pivot to some other absurd claim in the next year. |
02:22:41 | FromDiscord | <KingDarBoja> I see Volt being mentioned but no idea how that related to Vlang |
02:22:45 | leorize | "V is the first language to use machine learning to provide leak-free memory safe code" |
02:22:55 | zacharycarter | lol |
02:23:04 | Yardanico | Volt is a multi-service chat client *supposedly* written in V and *supposedly* using vlang's UI lib |
02:23:08 | disruptek | V is the last language to use machine learning. |
02:23:19 | FromDiscord | <KingDarBoja> Also, didn't know there was so much criticism on V but ofc, it is better to not trust because scammers could show up |
02:23:25 | kungtotte | They're working under the Dorothy model of software development where they make a claim, click their heels three times and wish for it really hard |
02:23:30 | * | muffindrake joined #nim |
02:23:51 | Yardanico | @KingDarBoja it would not receive critisicm if it didn't make very ambitious claims when it was in pre-alpha state |
02:24:09 | FromDiscord | <KingDarBoja> Yeah, I think the guy lost the focus and got too cocky |
02:24:14 | FromDiscord | <KingDarBoja> But let's see how it goes |
02:24:14 | disruptek | shashlick: just how many pairs of ruby slippers do you have in your closet? |
02:25:21 | kungtotte | I wonder how they're going to achieve hot code reloading since so many features depend on compiler magic |
02:25:24 | FromDiscord | <KingDarBoja> But holy cr*p that's a lot of money on patreon |
02:25:34 | Yardanico | just for a simple example of ambitious claims |
02:25:35 | Yardanico | https://github.com/vlang/gitly |
02:25:39 | Yardanico | very nice repository |
02:25:43 | shashlick | just sold my favorite pair a week ago on Craigs |
02:27:00 | disruptek | damnit. |
02:27:09 | FromDiscord | <KingDarBoja> Machine Learning Scam = Siraj Raval |
02:28:10 | FromDiscord | <KingDarBoja> Lol wtf that vlang repo |
02:28:17 | Yardanico | ok lets stop talking about it already :P |
02:28:22 | Yardanico | we have nim :) |
02:28:54 | disruptek | i heard there's a new package manager for nim where bugs aren't just fixed, they also inform features and growth in the compiler and the ecosystem as a whole. |
02:29:07 | * | FromDiscord <KingDarBoja> Mom, can we have Nim? We have Nim at home... Nim at Home: Python |
02:29:08 | Yardanico | disruptek: wow how much does it cost?! |
02:29:19 | disruptek | my bad. it's not new. |
02:29:29 | Yardanico | @KingDarBoja nim at home: Object Pascal |
02:29:34 | FromDiscord | <KingDarBoja> LOL |
02:29:42 | disruptek | people have been using it for six months and there have only been like 3 bugs reported. |
02:29:44 | FromDiscord | <KingDarBoja> Someone should start making Nim memes and share at offtopic |
02:29:49 | Yardanico | https://github.com/nim-lang/Nim/commit/405b86068e6a3d39970b9129ceec0a9108464b28 |
02:29:54 | Yardanico | for first commit in nim git repo |
02:30:04 | Yardanico | and yes its object pascal |
02:30:25 | Yardanico | although a lot of stuff looks the same as it is today :) |
02:30:33 | Yardanico | most of the core language didn't change since then |
02:31:13 | Yardanico | hmm I actually got curious, gonna try to compile it |
02:33:14 | Yardanico | nimrod 0.2.1 version |
02:39:31 | * | krux02 quit (Remote host closed the connection) |
02:39:32 | Yardanico | had to patch it a bit (change shell -> fpsystem since "shell" got removed in FPC) but it worked |
02:39:34 | Yardanico | it actually compiled |
02:39:50 | Yardanico | "Nimrod Compiler Version 0.2.1* (2020/04/17 05:39:30) [Linux: amd64]" |
02:42:13 | * | oculux quit (Ping timeout: 250 seconds) |
02:43:21 | Yardanico | wait what |
02:46:51 | leorize | Yardanico: 4raq wrote pas2nim for a reason |
02:46:56 | Yardanico | leorize: xddd |
02:47:22 | leorize | yep, a lot of the code in the current compiler can be traced directly to the pascal code |
02:48:02 | Yardanico | i know that :) really facsinating stuff |
02:48:32 | FromDiscord | <KingDarBoja> Awesome |
02:48:37 | FromDiscord | <KingDarBoja> Yard, how old are you mate? |
02:48:45 | Yardanico | I turned 20 today :D |
02:48:46 | FromDiscord | <KingDarBoja> I think I asked that before, right? |
02:48:50 | FromDiscord | <KingDarBoja> OH |
02:48:55 | FromDiscord | <KingDarBoja> Happy Birthday |
02:48:57 | disruptek | older now. |
02:48:59 | Yardanico | thanks |
02:49:01 | leorize[m] | happy cake day |
02:49:03 | FromDiscord | <KingDarBoja> Someone make a Nim cake and put him a Crown |
02:49:07 | disruptek | π |
02:49:26 | leorize[m] | π π |
02:49:45 | FromDiscord | <KingDarBoja> Can we have a Nim emoji on Discord? |
02:50:26 | Yardanico | I'll try to add nim crown now |
02:50:57 | leorize[m] | looks like Nim is not only consisted of old people :P |
02:51:01 | FromDiscord | <Yardanico> @KingDarBoja :nim1: |
02:51:08 | FromDiscord | <KingDarBoja> Ewww |
02:51:14 | FromDiscord | <KingDarBoja> Better the goldish crown |
02:51:19 | FromDiscord | <KingDarBoja> Hold on |
02:51:32 | Yardanico | the one on the website? |
02:52:04 | FromDiscord | <KingDarBoja> https://raw.githubusercontent.com/vscode-icons/vscode-icons/master/icons/file_type_nim.svg?sanitize=true |
02:52:24 | Yardanico | yeah that's the website one |
02:52:31 | Yardanico | https://nim-lang.org/assets/img/logo.svg |
02:52:36 | FromDiscord | <KingDarBoja> Yeah, svg 32x32 for ya, |
02:52:39 | Prestige | Is there a way to assign a variable to an iterator at the top level of a module? |
02:52:42 | Yardanico | svg doesn't have a size |
02:53:00 | Prestige | er assign an iterator to a variable* |
02:53:10 | Yardanico | well you can do that, yes |
02:53:14 | FromDiscord | <KingDarBoja> Viewport if you wish |
02:53:18 | leorize[m] | yes you can, the syntax is weird though |
02:53:23 | FromDiscord | <KingDarBoja> And maybe the nimble box? π |
02:54:04 | leorize[m] | note that us IRC users can't see your custom emojis |
02:54:10 | Yardanico | yeah |
02:54:31 | FromDiscord | <KingDarBoja> Oh :/ |
02:54:50 | Prestige | I can see them O.o |
02:54:55 | Yardanico | you can see the text |
02:54:59 | Yardanico | they're icons on discord |
02:55:08 | Prestige | https://0x0.st/iQUw.png |
02:55:25 | leorize | those are just unicode emojis |
02:56:02 | leorize | custom emojis are stuff like this :nim1: |
02:56:07 | FromDiscord | <KingDarBoja> What chat is that? IRC? |
02:56:09 | leorize | we can't see it, it's just text |
02:56:51 | leorize | that's weechat |
02:56:57 | leorize | customized I think |
02:57:05 | FromDiscord | <KingDarBoja> I love how we moved from E-v-il topic into emojis |
02:57:30 | FromDiscord | <Yardanico> :nim1: |
02:57:58 | FromDiscord | <KingDarBoja> Awesome! |
02:58:11 | FromDiscord | <KingDarBoja> Much better than the black-gold one |
02:58:30 | * | FromDiscord <KingDarBoja> A crown for the king, all kneel before Yardanico |
02:58:33 | Prestige | leorize: what was the syntax? I'm trying to do something like https://play.nim-lang.org/#ix=2im0 |
02:58:43 | disruptek | ~araq |
02:58:43 | Yardanico | we have a real king who goes by the name of 4raq :P |
02:58:43 | disbot_ | araq: 11π the powers that He π -- disruptek |
02:59:10 | FromDiscord | <Yardanico> @KingDarBoja :nimble: |
02:59:28 | Prestige | oh you all meant the :text: |
02:59:38 | leorize[m] | Prestige: https://play.nim-lang.org/#ix=2im2 |
03:00:00 | Yardanico | Prestige: on discord it's like this https://i.imgur.com/boZQxEH.png |
03:00:07 | Prestige | ah |
03:00:16 | Prestige | come join us on irc Yardanico :P |
03:00:25 | Yardanico | well I'm everywhere |
03:00:26 | leorize | he is on irc |
03:00:39 | disruptek | only chumps use irc. |
03:00:43 | Yardanico | nim forum, nim discord, nim gitter, nim telegram, nim github |
03:00:43 | Prestige | rip well all the discord folk come over |
03:00:57 | Yardanico | Prestige: well discord is more and more used for nim :) |
03:01:03 | FromDiscord | <KingDarBoja> nim whatssap? |
03:01:06 | FromDiscord | <KingDarBoja> Xd |
03:01:10 | FromDiscord | <KingDarBoja> NVM |
03:01:16 | Yardanico | Nim server has 820 members as of now, but most of them are not really active |
03:01:23 | leorize[m] | if I use matrix to bridge discord here, then everyone from discord will appear as irc users :P |
03:02:11 | Prestige | leorize[m]: that's interesting about the iterator example |
03:02:18 | Prestige | can we just not specify the type? |
03:02:24 | Yardanico | of course? |
03:02:36 | Yardanico | nim supports automatic type interference |
03:02:54 | leorize[m] | do specify the type if you have overloads though |
03:02:56 | Yardanico | you only need to use types in proc declaration/type declaration, in most other places it can be omitted |
03:03:03 | Yardanico | well you also need to specify them with generics |
03:03:09 | Yardanico | btw "auto" exists :P |
03:03:28 | Yardanico | and yes it can be even used for proc arguments |
03:03:48 | * | audiophile quit (Ping timeout: 256 seconds) |
03:03:55 | Prestige | I actually have a type/class that has the iterator as a member so I was hoping to type it, just curious how you'd write a type for that example |
03:04:29 | leorize[m] | Prestige: https://play.nim-lang.org/#ix=2im6 |
03:04:39 | leorize[m] | or easier, just `echo typeof(variable)` and you'll know what to put in there |
03:04:58 | Prestige | ah I see, thanks |
03:05:18 | leorize[m] | closure iterators are really weird |
03:05:18 | leorize[m] | https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-first-class-iterators |
03:05:24 | leorize[m] | take note of that before using them |
03:05:59 | FromDiscord | <KingDarBoja> A offtopic question (as most of you guys are on IRC) |
03:06:21 | FromDiscord | <KingDarBoja> Do you guys have a system engineer degree or something related? |
03:06:29 | FromDiscord | <KingDarBoja> Just curious |
03:06:35 | leorize | i don't have any degree |
03:06:36 | Yardanico | I'm 2nd year in uni (CS) |
03:07:22 | FromDiscord | <KingDarBoja> Noise, now I am feeling old here xD |
03:07:31 | Yardanico | how old are you? :P |
03:07:37 | FromDiscord | <KingDarBoja> 26 |
03:07:39 | leorize[m] | don't worry, we have our share of old people here too |
03:07:50 | leorize[m] | I think |
03:07:54 | FromDiscord | <KingDarBoja> No CS degree, only electronics & mechanical engineering |
03:08:15 | Prestige | no degree, 25 and work as a software engineer |
03:08:18 | Yardanico | ok now I have to figure out how to add break statement to my Lox interpreter (it's an exercise in the book) |
03:08:20 | FromDiscord | <KingDarBoja> Pushed into soft dev because no jobs for me |
03:08:40 | Prestige | trying to cross over from JS land |
03:08:46 | FromDiscord | <KingDarBoja> Awesome Presti |
03:09:01 | FromDiscord | <KingDarBoja> IMO, JS land is blessed with TS |
03:09:04 | FromDiscord | <KingDarBoja> Ofc not perfect |
03:09:20 | Prestige | Yeah, I just spend a while writing documentation for TS so our company can switch over |
03:09:24 | leorize[m] | nah, JS land is blessed with Nim :) |
03:09:27 | Prestige | just got approved by the VP this week |
03:09:46 | Prestige | Anyone writing JS using nim? I'm curious how nice it is to work with |
03:10:09 | Yardanico | well there's karax for SPA but I didn't try it |
03:10:15 | leorize[m] | I did write an app with it, but I'm not a frequent user |
03:10:18 | Yardanico | nim forum frontend is in Nim |
03:10:33 | * | rmnull quit (Quit: WeeChat 2.8) |
03:10:36 | FromDiscord | <KingDarBoja> karax ~= angular (?) |
03:10:41 | leorize[m] | alehander92 uses the JS backend a ton IIRC |
03:10:48 | FromDiscord | <KingDarBoja> ohhh |
03:11:11 | leorize[m] | according to an outdated benchmark, karax is lighter and faster than all major frameworks |
03:11:40 | Prestige | that's pretty awesome |
03:11:49 | FromDiscord | <KingDarBoja> x2 |
03:12:05 | FromDiscord | <KingDarBoja> Hopefully Nim will not have tons of libraries like JS on npm does |
03:12:20 | FromDiscord | <KingDarBoja> I mean, unnecessary, out of maintenance libraries |
03:12:38 | leorize[m] | we don't have unnecessary, but we do have rotting libraries |
03:14:35 | Yardanico | my interpreter is finally turing complete :D https://github.com/Yardanico/nim-lox/blob/master/examples/testloop.lox |
03:17:18 | Prestige | Reading about methods vs procs, methods are preferred for new object types right? Also looks like it requires a base pragma, now |
03:17:28 | Yardanico | not really |
03:17:35 | leorize | method and proc are different things |
03:17:38 | leorize | you can't compare them |
03:17:42 | * | FromDiscord <KingDarBoja> VSCode will raise a warning about using methods btw |
03:17:44 | Yardanico | the preferred is still "proc" unless you need runtime dispatch |
03:18:12 | Yardanico | what warning? |
03:18:18 | Yardanico | about --multimethods:on ? |
03:18:28 | Prestige | ah I see, thanks |
03:18:39 | FromDiscord | <KingDarBoja> I think it was that, can't remember |
03:18:47 | FromDiscord | <KingDarBoja> But pretty much I use procs everywhere |
03:18:54 | Yardanico | yeah, me too |
03:19:02 | Yardanico | there are object variants too |
03:19:03 | FromDiscord | <KingDarBoja> Even when I code Python stuff, I started to use proc isntead of def |
03:19:05 | Prestige | Cool, just want to make sure I'm using best practices |
03:19:06 | Yardanico | I use them in my interpreter |
03:19:37 | FromDiscord | <KingDarBoja> Best practices is relative |
03:19:46 | Yardanico | https://nim-lang.org/docs/nep1.html for style guide btw |
03:19:57 | Prestige | sweet |
03:20:02 | FromDiscord | <KingDarBoja> But if someone with a good background suggest you something, better follow it |
03:20:11 | FromDiscord | <KingDarBoja> Okay I am writing non-sense |
03:20:26 | Yardanico | this style guide also has a pretty good table of name conventions for identifiers |
03:20:33 | disruptek | prefer object variants to methods. |
03:20:41 | Yardanico | like initT, newP, find, contains, add, etc |
03:20:46 | disruptek | er, s/methods/object inheritance/. |
03:20:53 | leorize | https://nim-lang.org/docs/apis.html |
03:21:13 | Yardanico | yeah this table |
03:21:13 | Prestige | how have I not stumbled upon that link |
03:21:24 | leorize | iirc there were talks about removing methods and replace them with a macro |
03:21:53 | disruptek | strongly doubt that'd happen. |
03:22:09 | disruptek | but i expect dispatch performance will improve. |
03:23:51 | disruptek | i used to think that multi-methods were cool, and why would i not want that flexibility if it's supported? now i think it's pretty much a misguided feature. |
03:24:47 | FromDiscord | <KingDarBoja> I think I have followed everything except this |
03:24:52 | * | FromDiscord <KingDarBoja> The 'return' statement should ideally be used when its control-flow properties are required. |
03:24:53 | disruptek | probably i just need to encounter fewer inheritance bugs. |
03:25:08 | disruptek | use `result = something` instead. |
03:25:46 | FromDiscord | <KingDarBoja> I know, but used to return instead |
03:25:50 | disruptek | i almost never use return. prefer block: result = ... ; break |
03:26:11 | disruptek | it works, it's just code smell imo. |
03:26:17 | disruptek | style nit. |
03:26:52 | leorize | yep I also prefer `result` |
03:26:56 | disruptek | when you use result instead, you provide the ability to inspect the result at the bottom of the scope or add control flow there at a later date. |
03:27:00 | leorize | though it's a habit from my days of using pascal |
03:27:38 | disruptek | lean on block. it's awesome. especially named blocks. |
03:27:59 | leorize[m] | `return` is like `goto` |
03:28:10 | zacharycarter | what if you need to exit eraly from a function? |
03:28:13 | zacharycarter | early* |
03:28:16 | leorize[m] | it breaks your reading flow |
03:28:18 | zacharycarter | how do you avoid return? |
03:28:35 | leorize[m] | zacharycarter: structure it so that you don't have to, or use it if you can't |
03:28:41 | disruptek | break a block. |
03:28:54 | zacharycarter | I don't get the breaking a block thing |
03:29:01 | FromDiscord | <KingDarBoja> `break` |
03:29:02 | leorize[m] | nim-style goto |
03:29:04 | zacharycarter | no I get that |
03:29:17 | * | FromDiscord <KingDarBoja> Was trying to make a joke |
03:29:26 | disruptek | block found: for i in 0 .. 10: if foo[i]: break ... echo "not found" |
03:29:28 | zacharycarter | I know what break does and what a block is, I just don't understand how this helps |
03:29:34 | FromDiscord | <KingDarBoja> But being serious, I don't see harm on using return |
03:29:40 | FromDiscord | <KingDarBoja> But ofc, newbie here |
03:29:53 | disruptek | when you break a block, you skip the remaining statements in the block. |
03:30:01 | zacharycarter | ah okay |
03:30:15 | zacharycarter | so just wrap the entire proc body in a block essentially |
03:30:24 | leorize[m] | KingDarBoja: well there aren't any harm, but the reading flow is better when you use `return` less |
03:30:49 | disruptek | zacharycarter: yes, though obviously there are exceptions when that's just plain silly. |
03:30:53 | zacharycarter | yes |
03:30:58 | zacharycarter | but I now understand thanks |
03:31:06 | * | FromDiscord <KingDarBoja> you provide the ability to inspect the result at the bottom of the scope or add control flow there at a later date. |
03:31:10 | disruptek | i err on the side of silly. π |
03:31:13 | FromDiscord | <KingDarBoja> I don't get the idea, sorry |
03:31:27 | Yardanico | @KingDarBoja with "result" you don't "return" |
03:31:33 | disruptek | when you break the block, you haven't returned from the proc. |
03:31:35 | Yardanico | so the compiler is free to add whatever it wants at the end of the proc |
03:31:47 | leorize | Yardanico: it's not something for the compiler :P |
03:31:49 | disruptek | so after the block, you can add some inspection or debugging or w/e. |
03:31:49 | FromDiscord | <KingDarBoja> Ah ok |
03:32:20 | FromDiscord | <KingDarBoja> That's sounds useful |
03:32:25 | FromDiscord | <KingDarBoja> Ofc when needed |
03:33:16 | disruptek | https://github.com/disruptek/nimph/blob/master/src/nimph/project.nim#L403 |
03:33:35 | disruptek | i use return in something like 8% of my procs. you see block all over my code. |
03:34:05 | disruptek | that's an example of a simple and efficient exploit of the semantics for a typical found/unfound scenario. |
03:35:00 | disruptek | https://github.com/disruptek/nimph/blob/master/src/nimph/project.nim#L540 -- nested named blocks |
03:35:45 | FromDiscord | <KingDarBoja> That's seems very golang-like |
03:35:47 | FromDiscord | <KingDarBoja> But nice |
03:36:17 | leorize | nim blocks are `go to` but a bit better |
03:36:23 | FromDiscord | <KingDarBoja> Ok, that last one is another level |
03:36:34 | disruptek | they open new scopes. |
03:37:10 | Prestige | Going to push some code soon, would anyone mind reviewing it? Not many lines yet |
03:37:18 | * | zacharycarter quit (Ping timeout: 265 seconds) |
03:38:18 | leorize | sure, just post it here :) |
03:38:29 | FromDiscord | <KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/language/parser.nim#L867 me ~abusing~ using return |
03:38:51 | leorize | nah, that's not abusing return |
03:38:58 | Prestige | Thanks! - https://github.com/avahe-kellenberger/nimdow/tree/development leorize |
03:39:20 | Prestige | It will eventually be an actual window manager |
03:39:28 | leorize | https://github.com/alaviss/nim.nvim/blob/master/indent/nim.vim#L95 <- this is abusing return |
03:39:37 | disruptek | converters will hurt you in the end. |
03:39:55 | Prestige | ah what's wrong with converters? |
03:40:04 | leorize | I take literal days to fix a bug in that indent plugin |
03:40:07 | FromDiscord | <KingDarBoja> I will give you a star π |
03:40:09 | leorize | so I wrote a better one: https://github.com/alaviss/nim.nvim/blob/indent-rewrite/indent/nim.vim#L169 |
03:40:41 | leorize | Prestige: they have the weirdest semantics in Nim :) |
03:40:45 | disruptek | there are basically two uses of converters that i can get behind. |
03:40:55 | leorize | they apply when you don't want them to, and they don't apply when you want them to |
03:40:59 | FromDiscord | <KingDarBoja> Holy cr*p, that's a lot of if-else |
03:41:16 | disruptek | 1) grandfathering types; convert new to old, vice-versa. |
03:41:38 | leorize | @KingDarBoja: yep, but now everything is structured and you can follow the code |
03:41:56 | leorize | in the older version `return` was literally `goto` |
03:42:11 | * | nsf joined #nim |
03:42:19 | leorize | esp when vimscript hinders your ability to follow code by 150% |
03:42:25 | disruptek | hmm, i cannot remember my second use of converters. |
03:42:36 | Prestige | Should I just manually cast instead of using a converter? |
03:42:37 | disruptek | help me out, leorize. |
03:42:58 | disruptek | cast is unsafe. use foo.int32 or int32(foo) |
03:43:28 | Yardanico | Prestige: you don't need to specify "void" btw |
03:43:31 | leorize | https://github.com/avahe-kellenberger/nimdow/blob/development/nimdowpkg/event/xeventmanager.nim#L17-L19 <- this is weird syntax |
03:43:32 | Yardanico | as I said before |
03:43:42 | Prestige | Yeah I just like the verbosity cuz of old habbits |
03:43:58 | Yardanico | Prestige: oh, in the link above you don't need () |
03:44:03 | Yardanico | the one leorize shared |
03:44:15 | leorize | disruptek: sorry, I used converter once to try to mimic "object composition" and I'm scarred for life |
03:44:24 | * | rockcavera quit (Remote host closed the connection) |
03:44:34 | Yardanico | term rewriting macros are still more fun than converters though :DD |
03:44:39 | Prestige | Yeah, I kind of like having the separation |
03:44:48 | disruptek | i prefer my iteration with .items or .pairs to name those procs explicitly, but that's another style nit. |
03:44:51 | Prestige | maybe I'll just use a blank line instead |
03:45:23 | leorize | yea, a blank line is what people usually use |
03:45:34 | disruptek | https://github.com/avahe-kellenberger/nimdow/blob/development/nimdowpkg/event/xeventmanager.nim#L29 |
03:46:00 | leorize | ah, there it is, the evil use of return |
03:46:09 | disruptek | araq makes a good case for removing the return and inverting the if clause so it dominates the body of the proc. |
03:46:28 | Prestige | What do you mean by inverting the if clause? |
03:46:45 | disruptek | if e.theType in this.listenerMap: ..do things.. |
03:46:50 | Prestige | I usually return early to avoid a bunch of nesting |
03:46:56 | leorize | I think the `if not something: return` pattern was shepherd to people by C-family of language |
03:47:01 | disruptek | i used to code that way. |
03:47:25 | disruptek | i got better since i came to nim. |
03:47:34 | Prestige | What changed your mind about it? |
03:47:39 | disruptek | i still use block: if x: break if y: break if z: break sometimes. |
03:47:51 | disruptek | but i almost never use `continue`, either. it's sloppy. |
03:48:09 | disruptek | araq's point is that it helps the reader understand the nesting. |
03:48:13 | leorize | for me, turns out a bunch of nesting works better when you read the code than a return |
03:48:16 | Prestige | I think returning early makes it easier to read |
03:48:34 | disruptek | the problem is that you have to remember everything that the if clause is NOT. |
03:48:51 | disruptek | by the time you get half a page down, it's hard to see what's in play. |
03:49:04 | disruptek | easy for the author, hard for the reader. |
03:49:16 | leorize | https://github.com/alaviss/nim.nvim/blob/master/indent/nim.vim#L95 <- exactly what happened here |
03:49:28 | Prestige | Hm I always thought it was easier to read π€· |
03:49:40 | leorize | I `return` so much I can't even follow my own code :P |
03:49:45 | Prestige | although I like to make my functions very short |
03:49:47 | disruptek | it's subjective, of course. |
03:50:00 | disruptek | i'm just telling you that i changed my style recently. |
03:50:21 | disruptek | also, i'm old. |
03:50:30 | leorize | well, you'll understand once you got hit by it :) |
03:51:25 | Prestige | I used to program the other way but switch a few years ago |
03:51:33 | Prestige | switched* |
03:51:52 | Prestige | Anyway thanks for the feedback - guess most of it looked correct at least lol |
03:52:04 | leorize | remove all the `: void` please :) |
03:52:08 | disruptek | i don't like a lot of nesting, either. i also almost never have multi-line if clauses. |
03:52:48 | leorize | I hated nesting until I implemented code folding in nim.nvim :) |
03:53:08 | disruptek | i want to see how big procs are. |
03:53:19 | disruptek | i don't want to forget what's inside. |
03:56:59 | FromDiscord | <KingDarBoja> https://imgur.com/Cmv8yiR |
03:57:11 | disruptek | king i'm looking at your language parser. |
03:57:22 | disruptek | you realize that #[]# is not a doc comment, right? |
03:57:35 | FromDiscord | <KingDarBoja> WHAT |
03:57:47 | disruptek | ##[]## |
03:57:56 | disruptek | #[ is the multi-line version of # |
03:58:00 | FromDiscord | <KingDarBoja> π€¦ |
03:58:29 | disruptek | try multi-line let and var blocks. you might like them. |
03:58:40 | FromDiscord | <KingDarBoja> Thanks for the review, didn't know I was wrong |
03:58:51 | disruptek | also, they are nicer to read and have less impact on a diff. |
03:58:55 | FromDiscord | <KingDarBoja> Ah yeah, I think Rika said the same about AST type |
03:59:04 | disruptek | about what? |
03:59:04 | FromDiscord | <KingDarBoja> I mean, using a single one for all |
03:59:09 | disruptek | oh, yeah. |
03:59:31 | FromDiscord | <KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/language/ast.nim Look at this, scroll down a bit π± |
03:59:51 | leorize | Prestige: https://github.com/avahe-kellenberger/nimdow/blob/development/nimdowpkg/event/xeventmanager.nim#L6-L10 <- can share the type block |
03:59:54 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:00:08 | leorize | https://github.com/avahe-kellenberger/nimdow/blob/development/nimdowpkg/event/xeventmanager.nim#L13 <- unneeded `return`, though this is subjective |
04:00:21 | Yardanico | btw it's actually pretty fun to help people learn nim :P |
04:00:22 | Yardanico | e.g. see https://github.com/wiremoons/weather-nim/pull/2 |
04:00:23 | disbot_ | β₯ A lot of changes |
04:00:33 | FromDiscord | <KingDarBoja> Oh ffs, my internet is trash, I can't wait for the monday to get new ISP provider |
04:01:09 | Yardanico | although this PR is subjective too of course |
04:01:10 | Prestige | Thanks leorize :) |
04:01:44 | leorize | Prestige: I'd have to warn you that the `eventPoller` might not work the way you'd like it to |
04:01:50 | leorize | closure iterators are expensive |
04:02:17 | Prestige | was just about to read a link about closure iterators - what would u suggest, just a normal iterator? |
04:02:35 | leorize | read it first then decide if you wanna use it |
04:02:57 | leorize | I feel like you don't need this, though I've never written any WM |
04:04:53 | Prestige | just by the definition of an inline iterator, that sounds better |
04:05:11 | disruptek | usually we say newLocation() to alloc a new Location and then initLocation() to do some setup logic on it. |
04:05:37 | leorize | we use `create` for `ptr` and `new` for `ref` respectively |
04:05:40 | disruptek | you can simply result = Location(start: startToken.start, ...) |
04:05:43 | Yardanico | btw guys, a PR from the dark times of Nim https://github.com/nim-lang/Nim/pull/2849 |
04:05:45 | disbot_ | β₯ Feature #2811 hump, snake and now dash |
04:05:57 | Yardanico | apart from allowing unicode in identifiers it added ability to use unicode dash symbol in identifiers |
04:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:02 | Yardanico | (it got removed later though) |
04:06:20 | leorize | are you diving the history of nim? :P |
04:06:41 | * | supakeen joined #nim |
04:06:54 | Yardanico | was searching for "norecurse" in Nim, stumbled upon https://irclogs.nim-lang.org/10-01-2018.html and it turns out I actually saw this issue myself 2 years ago |
04:07:20 | FromDiscord | <KingDarBoja> disruptek: you reviewing it? |
04:07:27 | disruptek | i mean, i was. |
04:07:31 | FromDiscord | <KingDarBoja> oh |
04:07:35 | Yardanico | https://github.com/nim-lang/Nim/issues/2811 is the #2 commented issue in nim repo right now |
04:07:36 | disruptek | this kinda thing is pretty painful: |
04:07:36 | disbot_ | β₯ Unicode dashes as "lisp'ish" alternative to hump and snake notation |
04:07:42 | disruptek | https://github.com/KingDarBoja/Phosphate/blob/master/src/language/ast.nim#L25 |
04:08:15 | FromDiscord | <KingDarBoja> π |
04:08:26 | disruptek | π |
04:08:29 | Yardanico | the #1 being https://github.com/nim-lang/Nim/issues/8363 |
04:08:30 | disbot_ | β₯ Rework Nim's exception handling ; snippet at 12https://play.nim-lang.org/#ix=27OQ |
04:08:45 | FromDiscord | <KingDarBoja> Remember, it is a 1:1 port so I do it like a python guy |
04:09:04 | leorize | we are still working torward that proposal |
04:09:07 | disruptek | i get it. read some small projects to get ideas. |
04:09:12 | FromDiscord | <KingDarBoja> ofc I will improve my code |
04:09:22 | disruptek | everyone starts as a newbie. |
04:09:47 | disruptek | i am hesitant to recommend any of my smaller stuff because my style has already improved. |
04:10:14 | disruptek | and of course there's dogshit in my larger work, too. |
04:10:24 | Prestige | leorize: I think this may be better in general: https://play.nim-lang.org/#ix=2imm |
04:10:26 | disruptek | nim is very forgiving, though. |
04:10:42 | Yardanico | Prestige: you don't need to inherit from RootObj for XEventManager |
04:10:51 | Yardanico | you only need to inherit from RootObj if you want to inherit from your own object later |
04:10:52 | FromDiscord | <KingDarBoja> I know, I have been collecting suggestions on some text file |
04:11:00 | Prestige | Oh nice, thanks |
04:11:20 | FromDiscord | <KingDarBoja> And I will improve the code, just rushing the port a little bit |
04:11:52 | * | FromDiscord <KingDarBoja> Just a litle, been idle these days cuz job and wanting to chat here |
04:12:16 | disruptek | cool. |
04:12:23 | FromDiscord | <KingDarBoja> Btw, I haven't pushed latest features |
04:12:40 | FromDiscord | <KingDarBoja> Been dealing with the GraphQLError class to see what's need |
04:12:56 | disruptek | ima use that shit when it's done, btw. |
04:12:58 | FromDiscord | <KingDarBoja> But ended up writing extra utils as needed |
04:13:12 | disruptek | it will go into nimph for actions support. |
04:13:15 | FromDiscord | <KingDarBoja> Also, got accepted into the Graphql-python org yey |
04:13:15 | disruptek | github actions. |
04:14:46 | Yardanico | by the way I found a good way to format floats so they don't have ".0" if they don't have a floating-point part :P |
04:14:59 | Yardanico | formatBiggestFloat(ffDecimal, -1) and then trimZeros on that variable |
04:15:16 | disruptek | i just email my floats to timothee for print-out. |
04:15:22 | Yardanico | lul |
04:15:27 | FromDiscord | <KingDarBoja> lol |
04:15:30 | Yardanico | i use it for my interpreter since it only has floats for numbers |
04:15:39 | FromDiscord | <KingDarBoja> Oh just tested the let indent |
04:15:40 | disruptek | wut |
04:15:45 | FromDiscord | <KingDarBoja> This is some good stuff |
04:15:53 | Yardanico | disruptek: http://www.craftinginterpreters.com/ |
04:15:54 | disruptek | https://github.com/disruptek/gittyup/blob/master/gittyup.nim |
04:18:54 | disruptek | this thing is pretty cool, but it never could have been written without shashlick's nimterop. his work is the backbone of too many projects. we need insurance on him, i think. |
04:19:56 | disruptek | also, `once()` is a cute template to know about. |
04:20:25 | Yardanico | disruptek: what's it for? |
04:20:36 | Yardanico | oh found |
04:20:44 | Yardanico | "Executes a block of code only once (the first time the block is reached)." actually pretty nice, yeah |
04:21:34 | Prestige | hm seems weird that the bitops functions don't take varargs[T] |
04:21:37 | disruptek | so, converters... kinda like the auto keyword. |
04:21:51 | disruptek | very, very specific use-cases that you probably don't have. |
04:22:14 | disruptek | i used auto to write a generic against a type that wasn't exported, for example. |
04:22:22 | disruptek | very, very specific. |
04:23:24 | FromDiscord | <KingDarBoja> Is there a equivalent to Python unpack asterisk ? |
04:23:33 | Yardanico | for what specifically? |
04:23:36 | disruptek | nope. |
04:23:43 | FromDiscord | <KingDarBoja> Oh |
04:24:16 | disruptek | also, converters are less dangerous if not exported. that's a whole 'nother story. |
04:25:12 | disruptek | varargs is a little trappy, too. i advise against it. |
04:25:48 | disruptek | here's a demo of some abuse: |
04:25:52 | disruptek | !repo jsonconvert |
04:25:53 | disbot_ | https://github.com/disruptek/jsonconvert -- 9jsonconvert: 11lazy json node conversion 15 0β 0π΄ |
04:26:24 | Prestige | disruptek: just cuz of implicity or something? |
04:26:43 | Prestige | I could use a an array for this I suppose |
04:27:24 | disruptek | varargs are troublesome elsewhere in the language (macros) so they may hinder your code ultimately. |
04:27:34 | disruptek | openArray is probably what you want. |
04:27:35 | Prestige | cool, I'll use arrays then |
04:28:18 | disruptek | king: use discard less, if at all. |
04:28:56 | disruptek | basically, it's a nice feature and discard discards it. keep it and use it instead. |
04:29:33 | disruptek | okay, that's enough criticism for now. good on you guys for writing nim. keep it up! |
04:30:03 | leorize[m] | you can use this to format float |
04:30:06 | leorize[m] | !repo nim-ryu |
04:30:07 | disbot_ | https://github.com/disruptek/ryu -- 9ryu: 11ryu for nim 15 5β 2π΄ 7& 2 more... |
04:30:13 | disruptek | lol |
04:30:18 | leorize[m] | get you the nicest float :P |
04:30:30 | Yardanico | leorize[m]: "This repository has been archived by the owner. It is now read-only." hm |
04:30:31 | disruptek | not that one. |
04:30:44 | leorize[m] | if you feel like printing your float at x4 the speed, then |
04:30:45 | disruptek | !repo alaviss/nim-ryu |
04:30:46 | disbot_ | https://github.com/alaviss/nim-ryu -- 9nim-ryu: 11An implementation of the ryΕ« float-to-string conversion algorithm. This version is written from scratch based on the paper. 15 1β 0π΄ |
04:30:58 | leorize[m] | s/speed/x4 the time*/ |
04:31:01 | Yardanico | but there's no license :( |
04:31:13 | Yardanico | so it's all rights reserved |
04:31:27 | leorize[m] | ^ yea use that for x4 the time spent |
04:31:31 | leorize[m] | you got my word, it's ISC licensed |
04:31:36 | Prestige | So if I'm not to use converters, should I just manually cast ints to x.cint? |
04:31:41 | leorize[m] | I just forgot to push the license :p |
04:31:50 | disruptek | that's not a cast, but yes. |
04:31:56 | leorize[m] | though I might just re license it to MIT for easy adoption |
04:32:04 | disruptek | cast[cint](x) is a cast. |
04:32:15 | Prestige | That's what I am doing atm since I'm not using converters |
04:32:22 | Yardanico | right now I just do https://github.com/Yardanico/nim-lox/blob/master/src/types.nim#L21 and it works fine :D |
04:32:41 | disruptek | cint(x) is a safe conversion whereas cast[]() is not. |
04:33:02 | leorize[m] | `cast[]` in nim is `reinterpret_cast` in C++ |
04:33:31 | Prestige | ah thank you disruptek |
04:33:38 | Prestige | I couldnt find much on casting/type conversion |
04:33:39 | leorize[m] | the `Type(x)` is `static_cast` and/or `dynamic_cast` in C++ |
04:33:42 | leorize[m] | just in case you came from C++ :P |
04:34:03 | Prestige | I came from java and javascript D: |
04:34:11 | * | disbot_ is now known as disbot |
04:34:27 | nerdrat[m] | leorize[m]: I finally found the problem. I Wonder who else in here updated through `choosenim |
04:34:42 | leorize[m] | nice :) |
04:34:44 | disruptek | what was the issue? |
04:35:05 | disruptek | i mean, what was the solution? |
04:35:09 | nerdrat[m] | Choosenim is doing something weird at extracting the tarball |
04:35:36 | disruptek | that sounds like me in about 25mins. |
04:37:06 | disruptek | if you can shed more light on it, i think shashlick would be interested. |
04:38:22 | nerdrat[m] | I downloaded the tarball myself, verified the checksum both choosenim's and the one that extracted had the same checksum. However when I check the toolchain directory inside `.choosenim` directory, various files including the `nim.cfg` and all files inside `dist/nimble` were binary data!!!! I think choosenim is messing the tarball, I wonder who else had this problem? am I the only one? |
04:38:45 | disruptek | what platform? |
04:38:49 | leorize | probably the nimarchive version used was broken |
04:39:29 | nerdrat[m] | linux amd64 |
04:40:47 | leorize | I gotta write a proper cli library for nim sometimes |
04:41:23 | leorize | actually I planned that long ago when I was writing my own tool, but was too lazy to work on it :P |
04:41:26 | disruptek | nerdrat[m]: well, i'm surprised. but i don't use that choosenim. |
04:41:47 | disruptek | i use this one: https://github.com/disruptek/nimph/blob/master/choosenim |
04:42:31 | nerdrat[m] | I solved it copying the config directory from the tarball I extracted to the `.choosenim/config` "these are text files of course". And also all `dist/nimble`. |
04:44:02 | disruptek | i recommend using git. it works well and millions of people use it for software distribution every day. |
04:44:47 | nerdrat[m] | This is a problem. I wonder if dom96 is aware of this behavior. |
04:44:56 | * | Romanson joined #nim |
04:45:16 | disruptek | it's disappointing, yes. |
04:46:19 | disruptek | only shashlick can fix it, though. |
04:47:20 | FromDiscord | <KingDarBoja> I just read this -> king: use discard less, if at all. |
04:47:30 | FromDiscord | <KingDarBoja> The lag with my internet xD |
04:49:28 | nerdrat[m] | I saw this open issue but I don't know if it is directly related https://github.com/dom96/choosenim/issues/193 it seems so. |
04:49:30 | disbot | β₯ choosenim installs Nim/config/nim.cfg but not Nim/config/config.nims ; snippet at 12https://play.nim-lang.org/#ix=2imo |
04:49:40 | FromDiscord | <Varriount> Disruptek: You're still up? |
04:53:41 | Prestige | Hm I am not sure, but I don't think a window manager requires more than one thread.. |
04:54:08 | FromDiscord | <Zed> dumb question, how do you make a function return nothing? like c has void, kotlin Unit, what does nim have? |
04:54:28 | FromDiscord | <Varriount> Omit the return type, or put void |
04:54:32 | Prestige | implicit void |
04:54:40 | FromDiscord | <Varriount> Preferably the former |
04:56:42 | FromDiscord | <Zed> awesome thanks |
04:57:49 | shashlick | nerdcat[m]: good to know, so it is an extraction issue - that helps |
04:58:02 | shashlick | can you provide any info on your platform / OS |
04:58:15 | shashlick | nerdrat[m] rather |
05:01:47 | shashlick | what distro and version are you using |
05:03:30 | FromDiscord | <KingDarBoja> https://www.youtube.com/watch?v=lkaqxonhLLg |
05:03:50 | FromDiscord | <KingDarBoja> Oops, this isn't off-topic, ignore that |
05:10:26 | * | hpyc9 quit (*.net *.split) |
05:10:26 | * | Northstrider[m] quit (*.net *.split) |
05:10:26 | * | Spy653 quit (*.net *.split) |
05:10:26 | * | sirikon quit (*.net *.split) |
05:10:27 | * | Demos[m] quit (*.net *.split) |
05:10:27 | * | GitterIntegratio quit (*.net *.split) |
05:10:27 | * | BitPuffin quit (*.net *.split) |
05:10:27 | * | oprypin quit (*.net *.split) |
05:10:27 | * | FromGitter quit (*.net *.split) |
05:10:27 | * | golechwi1 quit (*.net *.split) |
05:10:27 | * | sepples quit (*.net *.split) |
05:10:27 | * | Northstrider quit (*.net *.split) |
05:10:27 | * | lmariscal0641 quit (*.net *.split) |
05:11:38 | FromDiscord | <Zed> im confused with nim, do you guys program in a main function? and then have all your code and function calls inside of there? or just write code and then call functions when you need them outside of a main |
05:11:52 | FromDiscord | <Zed> if that makes any sense |
05:13:20 | FromDiscord | <KingDarBoja> I do the second right now |
05:13:40 | FromDiscord | <KingDarBoja> Put all the code outside any main and just call it when need it |
05:13:53 | FromDiscord | <KingDarBoja> But ofc, I am a mewbie so someone expert on the topic should answer |
05:14:00 | FromDiscord | <KingDarBoja> newbie* |
05:14:01 | * | hax-scramper quit (Ping timeout: 264 seconds) |
05:15:04 | * | hpyc9 joined #nim |
05:15:04 | * | Northstrider[m] joined #nim |
05:15:04 | * | Spy653 joined #nim |
05:15:04 | * | sirikon joined #nim |
05:15:04 | * | GitterIntegratio joined #nim |
05:15:04 | * | BitPuffin joined #nim |
05:15:04 | * | Demos[m] joined #nim |
05:15:04 | * | Northstrider joined #nim |
05:15:04 | * | oprypin joined #nim |
05:15:04 | * | FromGitter joined #nim |
05:15:04 | * | golechwi1 joined #nim |
05:15:04 | * | sepples joined #nim |
05:15:04 | * | lmariscal0641 joined #nim |
05:15:14 | FromDiscord | <Rika> ah finally, booted into linux now |
05:15:43 | FromDiscord | <Rika> @Zed theres an optimization nim does when you do the former (i dont know why) |
05:17:49 | FromDiscord | <Zed> weird, are nim functions like C? where you have to define a function prototype if you want to use a function underneath your main code? |
05:18:14 | FromDiscord | <Zed> this language is really confusing me |
05:19:10 | * | narimiran joined #nim |
05:19:11 | Yardanico | @Zed yes you need forward declaration |
05:19:20 | Yardanico | there's also "reorder" pragma but it won't work if you have recursive dependency |
05:19:32 | Yardanico | e.g. if proc a calls proc b, proc b calls proc a |
05:19:55 | leorize[m] | the best practice is to just order it correctly |
05:20:18 | leorize[m] | make your program compiles faster, and the macro system also benefits from it |
05:20:43 | leorize[m] | and in Nim we don't have the idea of a "main" function |
05:21:04 | FromDiscord | <Rika> is the optimization thing i said right? |
05:21:07 | leorize[m] | modules instead have "initialization" code, which is called to initialize the module |
05:22:01 | leorize[m] | any top-level statement is a part of this initialization code |
05:22:07 | leorize[m] | @Rika yep |
05:23:22 | leorize[m] | the "write a main function then call it at the top-level" is a way to optimize the code |
05:24:26 | FromDiscord | <Rika> why though? |
05:24:48 | leorize[m] | this is mainly due to Nim interpreting any top-level variables as "global" (which isn't wrong), so optimizations can't be done on them. |
05:24:54 | leorize[m] | that's my speculation fwiw |
05:25:52 | leorize[m] | function-scoped variables are guaranteed to not be accessed outside of the stack frame, so they can be optimized away for example |
05:27:37 | leorize[m] | globals are never easy to optimize |
05:32:00 | FromDiscord | <Zed> how do you import a function from another file? looking through some nim code and they use |
05:32:01 | FromDiscord | <Zed> import function/fileWithfunctions |
05:32:01 | FromDiscord | <Zed> which i have done but i cant seem to use the functions i have imported |
05:32:09 | FromDiscord | <Zed> sorry for all the dumb questions guys |
05:32:21 | Yardanico | you need to export a symbol so other modules will be able to use it |
05:32:25 | Yardanico | you do that with an asterisk (*) |
05:32:36 | Yardanico | like proc myexportedproc*(...)... |
05:32:45 | Yardanico | or const MyUrl* = "stuff" |
05:33:23 | FromDiscord | <Zed> do you have too type |
05:33:23 | FromDiscord | <Zed> export thatFunction |
05:33:35 | FromDiscord | <Zed> i have seen this done somewhere |
05:35:42 | FromDiscord | <Zed> no you do not have to |
05:36:32 | leorize[m] | the export is for you to reexport some symbol from module you imported |
05:36:54 | leorize[m] | it's not something done often though |
05:56:00 | * | hax-scramper joined #nim |
06:05:36 | * | solitudesf joined #nim |
06:25:42 | * | silvernode joined #nim |
06:28:30 | silvernode | Got my first issue: https://github.com/silvernode/space-nim/issues/4 |
06:28:30 | disbot | β₯ Connect player with grid |
06:28:41 | * | xcm quit (Remote host closed the connection) |
06:30:54 | * | xcm joined #nim |
06:31:00 | silvernode | Haven't had time to really work on some of the suggestions people here gave me. Such as creating a position type with a reference to a grid type. Some terms were used in that suggestion that I don't understand, terms like "ofc". |
06:36:24 | silvernode | Creating a new branch called "grid" to experiment with code. I have never done a grid before so the code is probably not going to make sense. |
06:37:06 | * | PMunch joined #nim |
06:51:46 | * | tane joined #nim |
06:55:43 | * | silvernode quit (Ping timeout: 250 seconds) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:02:40 | * | NimBot joined #nim |
07:04:51 | * | gmpreussner joined #nim |
07:06:50 | * | lritter quit (Quit: Leaving) |
07:28:17 | * | xcm quit (Remote host closed the connection) |
07:30:32 | * | xcm joined #nim |
07:48:38 | * | liblq-dev joined #nim |
07:52:52 | * | Vladar joined #nim |
07:54:13 | * | Romanson quit (Quit: Connection closed for inactivity) |
08:05:36 | dadada | does somebody know whether staticRead/slurp cache their file reading? When different macros use staticRead in the same module, then you can assume there not be changes to the underlying source, so this is why I'm asking. |
08:08:19 | dadada | to clarify what I mean... when using staticRead to read Nim source files, of the same project, that the macro is running in, while macros run it can be assumed that the sources aren't changed |
08:08:44 | PMunch | Hmm, question. Nimlsp uses jsonschema which can be strict or relaxed when it comes to extra fields in the json data. This manifests in issues like the one Prestige had where it just refuses to do certain things. I like that nimlsp was strict, because it has led us to find at least two implementations with bugs in them, so I kinda want to keep it strict. But from a usability standpoint it should probably be lenient. Would defaulting it to strict |
08:08:44 | PMunch | but adding a flag to make it lenient and adding a section in the README about it telling you to turn on lenient mode and to report a bug with the editor in question be an acceptable solution? |
08:09:11 | PMunch | dadada, I don't think they cache |
08:09:31 | dadada | PMunch: okay, then I won't be stupid to use my own cache |
08:09:36 | dadada | s/be/feel |
08:27:35 | PMunch | Hmm, I generate a procedure and a forward declaration in a macro (in two different quote do blocks, later glued together). But I get an ambiguous error when I try to call it. Tried to make the name of the procedure an ident node and quote it in the quote do macro, but that didn't work.. |
08:27:49 | FromGitter | <faulander> good morning guys. since i am coming from python, what is the best way of implementing classes, init procs and class methods. If you could point me to a resource which explains that? |
08:29:03 | Yardanico | nim doesn't have classes, for init procs - just use initT if your object's type is "object", and newT if it's "ref object", like initTable if it's "object" and newTable if it's "ref object" |
08:29:27 | Yardanico | read https://nim-lang.org/docs/tut2.html#object-oriented-programming |
08:29:39 | Yardanico | contains quite a lot of useful info about OOP in nim, but you rarely need real methods and inheritance |
08:29:47 | PMunch | Aaah, all the parameter names need to be quoted.. |
08:30:25 | FromDiscord | <Recruit_main707> Faulander: I also came from python, donβt let nimβs simplistic OOP push you back, you will realize they have everything you will need |
08:30:56 | Yardanico | most stuff in nim is done via composition :) |
08:31:22 | Yardanico | also nim UFCS or MCS (method call syntax) is really good |
08:31:46 | Yardanico | a.b() == a.b == b(a) == b a |
08:31:56 | Yardanico | not in all contexts of course, but generally it's like this |
08:32:04 | PMunch | faulander, to expand on that Nim initialises memory to null when you create a new object. And most types are made to accept null as an empty state so you rarely need initialisation (e.g. `var x: Table[string, string]; echo x.hasKey("hello")` would work and return "false" even though the table isn't initalised) |
08:33:24 | Yardanico | well also it should be mentioned that some type have a proper "default" value |
08:33:27 | FromDiscord | <Rika> not null, zeromem |
08:33:36 | FromDiscord | <Rika> all default to default state |
08:33:43 | Yardanico | all the "primitive" types and all "object" types have a default value, not neccessarily correct one though |
08:33:44 | FromDiscord | <Rika> strings are "", ints 0, floats 0 |
08:34:04 | PMunch | Well yeah, I just assume that Python people don't necessarily know about things like zeromem.. |
08:34:06 | FromDiscord | <Rika> any objects that arent ref are initialized w/ fields that are in default state |
08:36:17 | Yardanico | also "ptr" and "pointer" are not initialized of course, but that's another topic :P |
08:37:05 | FromDiscord | <Recruit_main707> he left?? |
08:38:16 | FromDiscord | <Rika> who is he |
08:38:32 | FromDiscord | <Recruit_main707> Faulander |
08:39:06 | FromDiscord | <Rika> how do you know, are you in irc |
08:39:13 | FromDiscord | <Yardanico> Faulander is from gitter |
08:39:40 | FromDiscord | <Rika> didnt notice lol |
08:39:41 | FromDiscord | <mratsim> The citizen of this country are not accounted for |
08:39:45 | FromDiscord | <Recruit_main707> > how do you know, are you in irc |
08:39:45 | FromDiscord | <Recruit_main707> thats why i asked xD |
08:40:19 | Yardanico | English is not Nim, you can't just omit punctuation |
08:40:23 | Yardanico | ah nvm |
08:40:35 | Yardanico | I just thought that "he left???" was meant as a surprise on the fact, not the question |
08:40:49 | PMunch | Are you on IRC or in IRC? |
08:40:54 | PMunch | I've always said "on" |
08:40:54 | FromDiscord | <Rika> same here |
08:41:07 | PMunch | "in" a channel, but "on" the network |
08:41:12 | FromDiscord | <Rika> at |
08:41:13 | FromDiscord | <Rika> π |
08:41:17 | FromDiscord | <Recruit_main707> id say in ngl |
08:41:45 | Yardanico | PMunch: there's that thing about how to properly say "in Ukraine" in russian too |
08:42:20 | PMunch | Wouldn't that just be "in Russia" nowadays? /s |
08:42:29 | Yardanico | xd, not (yet) :D |
08:42:31 | Yardanico | some people say "Π² ΡΠΊΡΠ°ΠΈΠ½Π΅" -> "in ukraine", some say "Π½Π° ΡΠΊΡΠ°ΠΈΠ½Π΅" -> "on ukraine" |
08:42:59 | PMunch | Yeah it's always confusing for people learning Norwegian as well |
08:43:20 | Yardanico | well it's a political issue mostly :D |
08:43:40 | PMunch | Where I live "TromsΓΈ" you say in "TromsΓΈ" but the city is on an island named "TromsΓΈya" and you say on "TromsΓΈya" |
08:43:57 | PMunch | And of course we say in the kitchen and on the bedroom. |
08:44:05 | FromGitter | <faulander> oh, beautiful norway right? |
08:44:09 | Yardanico | PMunch: same about irc |
08:44:13 | Yardanico | "on github", "on discord" |
08:44:16 | PMunch | Oh no, we say on the kitchen as well, but in the living room |
08:44:18 | Yardanico | "in nim server on discord" |
08:44:19 | FromGitter | <faulander> and i am here, my browser just hang |
08:44:22 | * | solitudesf quit (Ping timeout: 256 seconds) |
08:44:30 | Yardanico | PMunch: we say "on the kitchen" -> "Π½Π° ΠΊΡΡ
Π½Π΅" too lol |
08:44:30 | PMunch | faulander, yeah Norway is quite beautiful :) |
08:44:59 | FromGitter | <faulander> i visited all european countries, but norway was too expensive to stay long ;) |
08:45:28 | PMunch | Hehe, yeah it's not the cheapest place to be |
08:45:42 | PMunch | Nice for us when we're on vacation though, pretty much anywhere else is comparatively cheap |
08:46:04 | FromGitter | <faulander> i am getting close to rewrite all of my python utilities in nim. i just struggle with the more complex ones. i am not sure to understand nims "Type"-System well. |
08:46:08 | PMunch | Not so much now though that the oil price and Norwegian currency has plummeted.. |
08:46:45 | FromDiscord | <Recruit_main707> Faulander: do you know about c/c++ structs? |
08:46:46 | FromGitter | <faulander> @pmutua : Except Switzerland ;) |
08:46:47 | FromDiscord | <mratsim> imagine in Venezuela |
08:47:23 | FromDiscord | <mratsim> oil price were already an issue and now covid drove them further down |
08:47:37 | * | solitudesf joined #nim |
08:48:14 | FromDiscord | <Recruit_main707> do we have some kind of python vs nim about oop? |
08:48:20 | FromGitter | <faulander> > *<FromDiscord>* <Recruit_main707> Faulander: do you know about c/c++ structs? β β unfortunatelly not. i was programming in 6502 assembler, all kind of basic dialects, then pascal, delphi, vb - then stopped programming for 20 years, started with python again 2 years ago |
08:48:26 | FromDiscord | <mratsim> @faulander, if you make everything a ref object, it works like Python |
08:48:55 | FromDiscord | <mratsim> pascal delphi can help you, there was a translator tool to convert pascal to Nim π |
08:49:11 | FromDiscord | <mratsim> bootstrapping was done in Pascal a very very long time ago AFAIK |
08:49:12 | FromGitter | <faulander> that was 30 years ago in school ;) |
08:49:19 | Yardanico | @mratsim yeah you're right |
08:49:21 | Yardanico | pas2nim |
08:49:25 | FromDiscord | <mratsim> well you didn't forget your multiplication tables did you? |
08:49:38 | FromGitter | <faulander> i cannot remember much, only that i liked that i don't need linenumbers :D |
08:49:55 | Yardanico | you can still find traces of pascal code in nim compiler |
08:50:14 | FromDiscord | <mratsim> 6502, that reminds me that my SNES emulator has been collecting dust for 2 years |
08:50:23 | FromGitter | <faulander> and that i hated the procedures had to be declared before usage - i like nims forward declaration. python has no such reglementation. |
08:50:28 | FromDiscord | <mratsim> the "type" follows Pascal record section |
08:50:55 | FromDiscord | <mratsim> Nim forward declaration is considered a limitation so will likely be lifted at one point |
08:51:14 | FromDiscord | <mratsim> you can already use {.reorder: on.} |
08:51:21 | FromGitter | <faulander> oh jesus. then i am f*cked. |
08:51:42 | Yardanico | reorder won't help if you have recursive dependency though |
08:51:46 | Yardanico | but yeah it's good |
08:51:46 | FromDiscord | <mratsim> well the issue with those is that you can't have files with types that depend on each other |
08:52:04 | Yardanico | nah I mean procedures |
08:52:10 | FromDiscord | <mratsim> which is a common pattern in other languages |
08:52:39 | Yardanico | proc a = b() proc b = a() I have a few places in my wip lox interpreter where I need forward decls, I'll probably refactor that once I finish the boot (or at least the first part) |
08:53:14 | FromDiscord | <mratsim> boot? is there an OS tutorial as well? |
08:53:32 | Yardanico | book* |
08:53:34 | Yardanico | sorry :P |
08:53:39 | Yardanico | http://www.craftinginterpreters.com/ |
08:54:00 | Yardanico | the book talks about implementing a simple C and JS-like language first in Java, then in C |
08:54:11 | Yardanico | I'm following it but instead of Java I use Nim |
08:54:59 | Yardanico | oh right you already know since you starred the repo :D |
08:56:34 | FromDiscord | <mratsim> Yeah, when I was trying to optimize interpreters 2 years ago I scoured the web for all interpreter resources |
08:57:39 | FromGitter | <faulander> so let me try to outline an example in python, would be nice if you could tell me how you would write that in nim, that would get me going: β class Person: β variable1 = "hello" β variable2 = 123 β ... [https://gitter.im/nim-lang/Nim?at=5e996f8263e7b73a5fe1551d] |
08:57:42 | FromDiscord | <mratsim> I saw that he published the last chapter about optimization, but it's too high-level for my needs which are optimizing the bytecode interpretation |
08:57:55 | FromDiscord | <mratsim> The sum of my interpeter optimization is collated here: https://github.com/status-im/nimbus/wiki/Interpreter-optimization-resources |
08:58:01 | FromDiscord | <mratsim> knowledge* |
08:58:53 | FromDiscord | <mratsim> @faulander, your edits are not transferred to IRC/Discord |
08:59:09 | Yardanico | huh, so I actually found the place where I needed to put "{.noinline.}" :P |
08:59:45 | Yardanico | was adapting https://forum.nim-lang.org/t/1305 (see bottom) to publish it on nimble, and turns out the C compiler aggressively inlines all calls to the decode procedure so for each string there's like 600 lines of assembly instructions added |
08:59:55 | Yardanico | after adding "{.noinline.}" it's fine though |
09:00:12 | FromGitter | <faulander> what is the irc server/channel= Would prefer it over gitter anyway, oldschool as i am |
09:00:19 | Yardanico | freenode #nim |
09:02:34 | dadada | is there any way to set the lineInfo of a NimNode manually? copyLineInfo only works if you already have a NimNode with a the lineInfo that you want, is there anything else? |
09:03:23 | dadada | parseExpr sets the macros.nim file/lines as fileInfo, which isn't helpful |
09:03:59 | * | Faulander joined #nim |
09:04:06 | Yardanico | yay |
09:04:23 | PMunch | dadada, I don't think so |
09:04:46 | dadada | PMunch: well, I suspected it :-( |
09:04:50 | Faulander | back in 1990! ;) |
09:04:54 | FromDiscord | <mratsim> @faulander, in pseudocode: https://play.nim-lang.org/#ix=2inp |
09:05:13 | PMunch | Welcome back! |
09:05:23 | FromDiscord | <mratsim> you have what I saw from the broken formatting at the top |
09:05:23 | Yardanico | with httpclient it's basically the same but getContent :P |
09:06:23 | Faulander | perfect @mratsim, that will get me going! |
09:06:46 | Faulander | oh, i need to learn IRC again haahaha |
09:07:05 | PMunch | What is there to learn? Text goes in, text comes out |
09:07:26 | FromDiscord | <mratsim> We said that in machine learning "garbage in, garbage out" |
09:07:28 | PMunch | W08el10l 12th02er04e 06ar08e 10co12lo02ur04s 06of08 c10ou12rs02e |
09:07:39 | Faulander | oh jesus, i did use IRC for some ... not very legal ... "things" back then |
09:08:02 | Faulander | registering nick, mentioning users, etc. |
09:08:23 | PMunch | mratsim, I was referencing this: https://photos.app.goo.gl/Y7DBUYSLpnt6Njj8A |
09:08:57 | PMunch | Woops, wrong link |
09:09:52 | * | couven92 joined #nim |
09:10:57 | PMunch | https://youtu.be/wb3AFMe2OQY?t=113 that's the link I meant to share |
09:11:06 | * | dddddd joined #nim |
09:13:29 | * | hax-scramper quit (Ping timeout: 256 seconds) |
09:13:31 | Faulander | i have added some comments and cleanup: https://play.nim-lang.org/#ix=2inr |
09:14:26 | dadada | I think there should be an optional argument for parseExpr/parseStmt (s: string, info: LineInfo = LineInfo()) (or something like that) ... |
09:14:43 | FromDiscord | <mratsim> you can use "let x = initPerson(...)" |
09:14:53 | FromDiscord | <mratsim> echo x |
09:15:08 | FromDiscord | <mratsim> and let value = x.someOtherProc() |
09:15:42 | dadada | parseExpr puts some default LineInfo now, that's not very helpful, this would help me to override it |
09:15:54 | FromDiscord | <Recruit_main707> Do we hav some kind of py2nim tool? |
09:16:14 | Faulander | and now it should be working python code ;) https://play.nim-lang.org/#ix=2ins |
09:16:17 | FromDiscord | <Recruit_main707> I probably ask the dumbest shits ever, sorry :P |
09:16:27 | FromDiscord | <mratsim> we do |
09:16:32 | FromDiscord | <mratsim> it was used at Status |
09:16:48 | FromDiscord | <mratsim> https://github.com/metacraft-labs/py2nim |
09:17:16 | PMunch | I think there was a macro as well that rewrote some Python code to Nim :P |
09:17:18 | FromDiscord | <Rika> was? |
09:17:39 | PMunch | Like you just typed Python code in your Nim file and it rewrote the AST to be actual Nim code |
09:17:48 | FromDiscord | <mratsim> 3rd commit of Nimbus was py2nim generated: https://github.com/status-im/nimbus/commit/8ce5fa17736cd582c5e22feac2b18ec64633e2c1 |
09:17:49 | PMunch | I think it was just a for fun project though |
09:18:04 | FromDiscord | <Recruit_main707> It could be useful |
09:18:04 | FromDiscord | <mratsim> was because it was for bootstrapping |
09:18:16 | FromDiscord | <Recruit_main707> How reliable it is? |
09:18:28 | Yardanico | PMunch: yeah it's in nimpylib |
09:18:34 | FromDiscord | <mratsim> then we cleaned up the code, removed all the OOP and built Nim code |
09:18:37 | Yardanico | but it's almost entirely useless, just to show off :P |
09:19:06 | FromDiscord | <mratsim> it's serviceable but you will get Python-like code with lots of ref objects and methods |
09:20:03 | Faulander | that would help me alot ... i don't want to write python code and convert it, i want to learn the nim way of doing things, and if i can write python code, that would translate into how nim is doing it structurewise, that would be of immense value |
09:21:06 | Yardanico | well it won't show how "proper" nim should be written :P |
09:21:21 | FromDiscord | <Recruit_main707> Just donβt take it as the Nim way |
09:21:24 | FromDiscord | <mratsim> did you read this btw? https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers |
09:21:51 | FromDiscord | <mratsim> in particular the section about objects: https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#objects |
09:22:53 | FromDiscord | <Recruit_main707> Being efficiency the most important feature, and having imho the cleanest syntax of all the programming languages shows how great of a project Nim is |
09:23:12 | FromDiscord | <Rika> am i the only dumbass who makes ref seq[] fields or is it totally valid to have ref seq[] fields |
09:23:56 | FromDiscord | <mratsim> ref seq are valid and Araq made some ref seq for TableRef iirc |
09:24:19 | Yardanico | yeah it is valid |
09:24:26 | Yardanico | a pointer to a pointer to seq data |
09:24:29 | FromDiscord | <mratsim> I prefer to use type foo[T] {.shallow.} = object \n data seq[T] |
09:24:36 | Faulander | aaah, that link is glorious. thanks mratsim! |
09:24:37 | FromDiscord | <mratsim> this avoids a ref indirection |
09:24:49 | Yardanico | you can do "ref ref ref ref seq[int]" :P |
09:25:45 | FromDiscord | <Rika> ref seq[] is valid, but is it smart |
09:26:11 | FromDiscord | <Recruit_main707> from my complete ignorance, Iβm gonna say no |
09:26:17 | FromDiscord | <Rika> i just want to be able to share a seq, where contents are changed in both "accessors" |
09:26:35 | FromDiscord | <mratsim> there are tests for ref seq |
09:26:39 | FromDiscord | <mratsim> 5* |
09:27:03 | FromDiscord | <Rika> i'd like a better solution of course since seqs are pointers internally no |
09:27:04 | FromDiscord | <mratsim> yes in that case use ref seq |
09:27:22 | FromDiscord | <Rika> is that the only possible way? or can i escape refseq |
09:27:29 | FromDiscord | <mratsim> you can use raw pointers |
09:27:44 | FromDiscord | <mratsim> with finalizers |
09:27:53 | PMunch | Hmm, could nimsuggest support semantic highlighting? |
09:27:56 | FromDiscord | <Rika> that sounds debatably worse |
09:28:13 | FromDiscord | <Rika> I HEARD SEMANTIC HIGHLIGHTING? |
09:28:17 | * | chemist69_ quit (Quit: WeeChat 2.7) |
09:28:24 | FromDiscord | <mratsim> something like this: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/cuda.nim#L29-L41 |
09:28:28 | FromDiscord | <Rika> (tbh though i really want that in vscode-nim) |
09:28:34 | * | chemist69 joined #nim |
09:28:57 | PMunch | Rika, yes I'm looking at the proposed LSP spec for doing semantic highlighting |
09:29:35 | PMunch | Hmm I guess the highlight command in nimsuggest should give me everything I need |
09:30:56 | dom96 | Reports of choosenim corrupting the extracted files, doesn't bode well for nimarchive :( |
09:31:17 | FromDiscord | <Rika> ??? really? |
09:31:34 | PMunch | nimarchive? |
09:33:38 | dom96 | oh, I see shashlick stepped in, thank you shashlick. |
09:34:39 | Faulander | type Animal = ref object of RootObj --> inheritance, type Animal = object --> new object? |
09:35:12 | FromDiscord | <Rika> 1st is reference object, basically "pointer to actual object" |
09:35:31 | FromDiscord | <Rika> 2nd is regular object, can still have "inheritance" but i dont think it works too well |
09:36:27 | * | waleee-cl joined #nim |
09:37:04 | dom96 | nerdrat[m], please report this as an issue on GitHub if you can. You can also give choosenim 0.4.0 a try, it's the version before nimarchive was introduced: https://github.com/dom96/choosenim/releases/tag/v0.4.0 |
09:40:03 | PMunch | Looking at the Java language server and getting PTSD from my Java days |
09:40:11 | PMunch | The project is 1148 files.. |
09:40:14 | PMunch | Not lines, files |
09:40:18 | Yardanico | what |
09:40:24 | Zevv | 1448 lines, that's not much! |
09:40:29 | Yardanico | Zevv: LMAO |
09:40:44 | Yardanico | oh java is 1 class per file right |
09:40:54 | Yardanico | everything MUST be OOP, every single thing |
09:41:04 | * | krux02 joined #nim |
09:41:12 | Yardanico | PMunch: can you give link please? |
09:41:20 | PMunch | https://github.com/eclipse/eclipse.jdt.ls |
09:41:29 | PMunch | For comparison nimlsp is 40 files |
09:41:36 | PMunch | Oh wait.. |
09:41:43 | PMunch | It counts the .git folder.. |
09:41:50 | Yardanico | PMunch: 120 thousand lines of Java code |
09:41:53 | Yardanico | what the heck |
09:42:00 | Yardanico | (I counted with cloc) |
09:42:07 | Yardanico | and that's excluding comments |
09:42:11 | Yardanico | and blank lines |
09:43:00 | Yardanico | now I wonder if I should add my 30-line library to nimble .. |
09:43:12 | PMunch | nimlsp is 14 files, java lsp is 1009 files.. |
09:43:26 | Yardanico | I mean people asked in https://forum.nim-lang.org/t/1305 but I refactored it a bit so it's just 30 lines now |
09:43:31 | Faulander | rika, do correctly understand you. if intend to use inheritance i use ref object, if not, i CAN use object, but also ref object, correct? |
09:43:46 | FromDiscord | <Rika> yes yes |
09:43:47 | Yardanico | Faulander: yes, but there's other difference too |
09:44:03 | Yardanico | if you use "object" and want to modify the instance in the proc you'll need to add it as "var MyType" in arguments |
09:44:09 | FromDiscord | <Rika> object is usually copy by value, ref object is "copy by reference" |
09:44:12 | Yardanico | but when you have "ref object" you just write it as "MyType" |
09:44:13 | Yardanico | yeah |
09:44:24 | FromDiscord | <Rika> techinically theyre both by value, just the value being copied differs |
09:44:52 | Faulander | hmm, i need to try that out to correctly understand i think. |
09:45:11 | PMunch | Lines in the project as counted by "find . -not -path '*/\.*' -type f -exec cat {} \; | wc -l" |
09:45:26 | PMunch | Java LSP: 230211, Nim LSP 1785 |
09:45:32 | Yardanico | PMunch: well seems like it has a lot of Eclipse-specific stuff too |
09:45:43 | PMunch | No, that's not a typo, 230k lines of.. stuff.. |
09:45:56 | PMunch | Still.. |
09:45:58 | Yardanico | and cloc gives 120k lines of pure Java code (without comments and blank lines) |
09:46:06 | Yardanico | for nimlsp "cloc" gives 1314 lines of pure code :) |
09:46:25 | Faulander | so i understand "cope by reference right"? Copy by value is clear, thats a separate copy, copy by ref means if i change the referenced object, the reference object is changed too? |
09:46:52 | Yardanico | Faulander: if you pass your "ref object" to a procedure it can change it, yes |
09:47:01 | Yardanico | even if your "ref object" instance was declared with "let" |
09:47:20 | Yardanico | because "let" actually still works there -> it won't let you modify the reference itself |
09:47:28 | FromDiscord | <Rika> ok so faulander, `var a = someObject; var b = a; changing b will not change a` |
09:47:49 | FromDiscord | <Rika> `let a = someRef; let b = a; changing b will change a too` |
09:48:19 | Faulander | thanks Rika, thats exactly what i meant |
09:49:23 | PMunch | Just to put this into context, the Nim compiler (as counted by "find . -name '*.nim'") consists of 336890 lines |
09:49:46 | Yardanico | and that's including the whole stdlib |
09:49:46 | PMunch | The Java LSP plug-in is more than 2/3 the size of the entire Nim compiler and tools.. |
09:49:51 | PMunch | Yup |
09:49:52 | Faulander | so if i only have one instance of the object in my program, i can savely use ref object without putting much thought in it |
09:50:03 | Yardanico | with "cloc compiler/" it's just 60k lines of compiler code (with 7k blank and 10k comments) |
09:50:32 | PMunch | So by cloc the Java LSP plug-in is twice as much code as the entire Nim compiler, tools, and stdlib |
09:50:45 | PMunch | No wonder RSI is a big problem in the software industry.. |
09:50:58 | Yardanico | well not exactly :P |
09:51:09 | Yardanico | Nim repo has 260k lines of Nim code in total |
09:51:25 | PMunch | Ah okay :P |
09:51:33 | Yardanico | wonder where does that amount come from, hmm |
09:51:34 | PMunch | I was wondering how much documentation was in there :P |
09:51:49 | PMunch | Cloc should have a mode like baobab |
09:51:55 | Yardanico | ah right |
09:52:00 | Yardanico | "tests" 100k lines of Nim code :DDDDD |
09:52:05 | Yardanico | more than the whole compiler |
09:52:56 | FromDiscord | <mratsim> Tests for such complex piece of machinery are expected to be longer than the code |
09:52:56 | Yardanico | PMunch: yeah it has "--by-percent" |
09:53:29 | FromDiscord | <mratsim> each "if/elif/else" or case statements technically needs a factor 2 to N more tests to cover all branches |
09:54:55 | PMunch | Yardanico, should have a mode to output as .dot circle diagram :P |
09:55:00 | Yardanico | oh |
09:58:41 | Yardanico | hmm can't find it in "cloc" program |
09:59:14 | Yardanico | Cloc being https://github.com/AlDanial/cloc |
10:01:29 | * | abm joined #nim |
10:01:49 | PMunch | Oh no, not that kind of should, the other kind |
10:01:55 | PMunch | As in, they should have implemented it |
10:11:01 | PMunch | Hmm, I appear to need a hierarchy of style scopes to implement this semantic highlighting feature |
10:12:47 | PMunch | http://ix.io/2inQ <- something like this |
10:13:08 | Yardanico | lol |
10:14:30 | PMunch | For all of these kinds: https://nim-lang.org/0.19.2/idetools.html#parsing-idetools-output |
10:17:47 | PMunch | Hmm, highlight doesn't do string literals.. |
10:18:32 | PMunch | Not sure if this is really sufficient to implement syntax highlighting.. |
10:18:33 | PMunch | http://ix.io/2inS |
10:22:07 | PMunch | I guess I could implement some basic keyword recognition as well |
10:22:17 | PMunch | Along with strings and comments |
10:22:24 | Yardanico | yay |
10:22:32 | Yardanico | I mostly use VSCode because of the Nim extension |
10:22:48 | Yardanico | if there was a way to have good Nim support in an editor like Sublime Text or similar I would use it instead :P |
10:22:52 | Yardanico | and nimlsp solves that |
10:29:31 | PMunch | Exactly |
10:33:07 | dom96 | I'm constantly considering writing my own Nim extension for VS Code |
10:33:15 | Yardanico | in Nim? :P |
10:33:18 | dom96 | no |
10:33:20 | PMunch | Help with NimLSP instead :) |
10:33:28 | Yardanico | what's wrong with current nim extension for vscode though? |
10:33:42 | FromDiscord | <Recruit_main707> its wonky |
10:33:47 | Yardanico | I know it has its own issues but not sure why a full rewrite is needed |
10:34:08 | * | sunwukong joined #nim |
10:34:16 | * | fredrik92 joined #nim |
10:35:07 | PMunch | For every fix in NimLSP you fix something for every editor, much less cumulative work |
10:36:47 | * | couven92 quit (Ping timeout: 256 seconds) |
10:37:02 | Araq | I would have fixed it a long time ago but it's much code written in TypeScript and I don't even know how to test out my changes |
10:37:37 | * | fredrik92 is now known as couven92 |
10:39:34 | krux02 | Yardanico, A full rewrite is usually necessary if the old codebase is unmaintainable and the original maintainer is gone (probably because of this state) |
10:40:31 | Araq | or maybe because he was paid to do it and found a new job... |
10:40:43 | Yardanico | lol |
10:40:53 | Yardanico | well the original creator of vscode-nim still seems to make occasional commits https://github.com/pragmagic/vscode-nim/commit/dbff0e830945a059f1990461c7c8215ede8dc822 |
10:41:03 | Araq | the original author is rarely the person who thinks "omg my code is so messy it needs to die already" |
10:41:39 | * | zacharycarter joined #nim |
10:41:43 | FromDiscord | <Recruit_main707> pragmatic has some of the bes projects of nim, but he tends to abandon the ones i like the most :p |
10:41:51 | Yardanico | it's not a single person |
10:41:58 | Yardanico | "Pragmagic, Inc." |
10:42:07 | Yardanico | http://pragmagic.io/ |
10:42:08 | dom96 | Yardanico, it does a lot of annoying things, the bracket behaviour is wrong for example. |
10:42:12 | Yardanico | they even mention nim on their page |
10:42:27 | FromDiscord | <Recruit_main707> the more you know |
10:42:48 | dom96 | So I don't have a lot of confidence that the extension is well built |
10:51:13 | FromDiscord | <flywind> A new async http server(based on asyncdispatch and nativesockets). Now it works and begins to add more tests. |
10:51:16 | FromDiscord | <flywind> https://github.com/iocrate/netkit |
10:51:33 | FromDiscord | <Recruit_main707> nice |
10:52:16 | FromDiscord | <Rika> Interesting |
10:56:51 | dom96 | Nice! |
11:00:26 | zacharycarter | why doesn't it bill itself as that then? the project description is rather misleading |
11:00:49 | Yardanico | zacharycarter: ? |
11:01:09 | zacharycarter | instead of - Out-of-the-box, stable and secure network facilities and utilities written by pure Nim. |
11:01:33 | Yardanico | "Netkit is not intended to be a high-level productivity development tool" is about development, not usage |
11:01:43 | Yardanico | " ut rather a reliable and efficient network infrastructure." (but) |
11:01:58 | zacharycarter | yeah but the only functionality I see is an async http server |
11:02:03 | zacharycarter | not really network facilities and utiltiies |
11:02:07 | FromDiscord | <flywind> Now only server part is finished. |
11:02:08 | Yardanico | well they'll add more later (TM) |
11:02:33 | zacharycarter | well what else is going to be added? it mentions TCP / UDP/ Websockets |
11:02:41 | zacharycarter | that's pretty vague |
11:03:13 | * | narimiran quit (Ping timeout: 264 seconds) |
11:03:32 | zacharycarter | I still find myself going to enet for reliable udp sockets |
11:05:01 | zacharycarter | either way - cool stuff |
11:06:07 | Yardanico | there's also https://github.com/zielmicha/reactor.nim |
11:06:15 | Yardanico | but it's not really maintaned |
11:06:23 | Yardanico | but has quite a lot of stuff implemented |
11:06:27 | FromDiscord | <Rika> ooh reactor style |
11:06:45 | Yardanico | not really |
11:06:45 | zacharycarter | I've never gotten anywhere with that project |
11:07:11 | PMunch | I think I might have a problem with implicit return abuse: http://ix.io/2io0/nim |
11:07:33 | FromDiscord | <Yardanico> @flywind https://github.com/zielmicha/reactor.nim worth checking out as it's related to your project |
11:07:40 | Araq | PMunch: definitely. |
11:08:30 | dom96 | Rika: pretty sure async await itself is an example of the reactor pattern |
11:09:11 | Araq | once again, we need an async that works with --gc:arc |
11:09:33 | FromDiscord | <flywind> Thanks. I'll check it. @Yardanico |
11:09:56 | Yardanico | Araq: would it be hard for current implementation to support it? |
11:10:00 | * | Romanson joined #nim |
11:10:25 | Araq | Yardanico: IME yeah, it's very hard. |
11:10:31 | PMunch | It used to be worse though: http://ix.io/2io2/nim |
11:10:34 | Araq | it works with --gc:orc though |
11:10:49 | PMunch | --gc:urukhai |
11:11:02 | Yardanico | ahaha |
11:11:14 | Yardanico | "Uruk-hai (for short, Uruks) were brutal warriors of Middle-earth, and the strongest Orcs" ORCs :DD |
11:11:36 | Araq | thanks for the lecture |
11:11:45 | PMunch | Huh, didn't know they were considered orcs |
11:11:56 | Araq | but I think many knew already |
11:13:08 | FromDiscord | <Rika> not me |
11:16:55 | livcd | does nim-chronos work with arc? |
11:18:38 | FromDiscord | <Rika> only one way to test |
11:36:27 | * | couven92 quit (Read error: Connection reset by peer) |
11:36:55 | * | couven92 joined #nim |
11:43:54 | zacharycarter | Araq: is the fix for https://github.com/nim-lang/Nim/issues/13935 to not make this assert - https://github.com/nim-lang/Nim/blob/a6682de0045468ae1d15afbd2fd5378960e15eb7/lib/system/mmdisp.nim#L87 - when `nimV2` is defined? |
11:43:57 | disbot | β₯ SIGSEV encountered when creating threads in a loop w/ --gc:arc ; snippet at 12https://play.nim-lang.org/#ix=2ioe |
11:47:05 | Yardanico | zacharycarter: I don't think so, sysAssert is just an assert |
11:47:17 | * | sunwukong quit (Quit: Leaving) |
11:47:17 | Yardanico | it's a template which only checks if condition is false |
11:47:31 | Yardanico | and if -d:useSysAssert is defined and it's false, it prints out a message |
11:47:36 | Yardanico | it doesn't quit the program or anything like that |
11:55:40 | * | rockcavera joined #nim |
11:58:04 | zacharycarter | hmmm |
11:58:53 | * | leth joined #nim |
11:59:16 | leth | is there a way to join arrays together in a static block? |
11:59:26 | leth | (a simple way) |
11:59:37 | FromDiscord | <Recruit_main707> do we have any web browser made in Nim?? |
12:00:36 | Yardanico | that's a very complex task if you actually mean implementing a whole browser (with layout, rendering, etc) in Nim |
12:00:37 | Yardanico | so no |
12:01:27 | FromDiscord | <Recruit_main707> :( |
12:01:28 | * | couven92 quit (Read error: Connection reset by peer) |
12:01:53 | * | couven92 joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:46 | * | supakeen joined #nim |
12:07:45 | FromDiscord | <Rika> even firefox is just partially in rust |
12:08:21 | Yardanico | just a tiny bit though |
12:08:33 | Yardanico | most of it is C/C++/JS of course |
12:09:09 | * | dadada quit (Ping timeout: 256 seconds) |
12:09:25 | Yardanico | browsers are the most complex single piece of software we have nowadays |
12:09:47 | Yardanico | like chromium literally can take 50-100 times longer to compile than linux kernel |
12:10:42 | * | dadada joined #nim |
12:10:51 | FromDiscord | <Rika> all because it has to implement 3 languages |
12:11:05 | * | dadada is now known as Guest44318 |
12:11:27 | Yardanico | HTML and CSS are not programming languages though :P |
12:11:45 | FromDiscord | <Recruit_main707> the forbidden debate :0 |
12:11:47 | FromDiscord | <Rika> i said LANGUAGES |
12:11:51 | Yardanico | which ones? |
12:11:56 | FromDiscord | <Rika> did i say programming did i |
12:11:57 | FromDiscord | <Rika> hmmmmmmmm |
12:12:04 | FromDiscord | <Rika> smh cant read |
12:12:24 | * | someunknownuser joined #nim |
12:14:21 | PMunch | Haha :P |
12:16:10 | * | xcm quit (Remote host closed the connection) |
12:16:39 | * | narimiran joined #nim |
12:17:17 | FromDiscord | <Generic> can the nim compiler invoke multiple c compiler instances in parallel? |
12:17:28 | FromDiscord | <Generic> like make -j4 |
12:18:11 | * | xcm joined #nim |
12:18:32 | Yardanico | it does that by default |
12:18:36 | PMunch | @Generic, --parallelBuild:4 |
12:18:37 | lqdev[m] | @Generic it does that by default |
12:18:41 | PMunch | Oh it does? |
12:18:47 | Yardanico | yes |
12:18:53 | PMunch | Neat |
12:18:59 | Yardanico | https://nim-lang.org/docs/nimc.html "0 for auto detect" |
12:19:00 | Yardanico | and 0 is default |
12:19:05 | PMunch | Right |
12:19:07 | Yardanico | on my 3700X it uses all 16 threads |
12:19:48 | Yardanico | so the compilation is pretty darn fast :P |
12:20:18 | FromDiscord | <Generic> ah, then it must have been the lack of conflicting console outputs which kept me from noticing it |
12:38:57 | * | Romanson quit () |
12:43:34 | * | solitudesf quit (Ping timeout: 256 seconds) |
12:45:04 | FromGitter | <sealmove> guys, I am trying to play around with some windows paths but some procs don't work with them. Do I have to convert `\`s to `/`? |
12:46:18 | Yardanico | you can use / proc |
12:46:34 | FromDiscord | <Rika> "parent" / "childdir" |
12:46:35 | Yardanico | like "myfolder" / "myfolder2" / "myfile.nim" will construct a path with DirSep for the OS |
12:46:38 | FromDiscord | <Rika> in `os` |
12:46:43 | Yardanico | so if you're on linux it'll use /, on windows \ |
12:46:46 | FromDiscord | <Rika> module `os` |
12:46:55 | FromGitter | <sealmove> when I use `/` proc I get a mixed string with `\` and `/` |
12:47:02 | FromDiscord | <Rika> ? really? |
12:47:04 | Yardanico | yes they're escaping and stuff |
12:47:07 | Yardanico | they'' work anyway |
12:47:14 | FromDiscord | <Rika> i mean \ AND / for windows? |
12:47:18 | FromGitter | <sealmove> I mean, I already have a string with `\`s and want to manipulate it |
12:47:40 | FromDiscord | <Rika> thatString / newString to add a folder then |
12:47:54 | FromGitter | <sealmove> yes, this gives me mixed string |
12:48:07 | FromDiscord | <Rika> can you show the output |
12:48:58 | Yardanico | @sealmove oh then that's harder |
12:49:01 | Yardanico | well actually wait |
12:49:15 | Yardanico | maybe you do stuff like "myfolder1/" / "myfolder2" ? |
12:51:30 | FromGitter | <sealmove> https://play.nim-lang.org/#ix=2iov |
12:51:46 | FromDiscord | <Rika> i mean show output since playground is linux |
12:52:09 | FromGitter | <sealmove> I am working on linux, but the paths are taken from Windows |
12:52:17 | FromDiscord | <Rika> then thats the reason |
12:52:29 | FromDiscord | <Rika> maybe set nim to compile for windows |
12:52:57 | * | tane quit (Quit: Leaving) |
12:53:04 | Yardanico | yes |
12:53:09 | FromGitter | <sealmove> hmm, or I can manually convert the string to linux format in order to use the procs and then convert it back to Windows format? |
12:53:17 | Yardanico | you need --os:windows or manually concat with "\" |
12:53:39 | FromGitter | <sealmove> I see, thanks |
12:55:17 | * | opi joined #nim |
12:57:50 | * | Romanson joined #nim |
12:59:56 | shashlick | dom96 second time someone has had extraction issues but not sure what how to debug without reproducing locally |
13:00:06 | * | dwdv joined #nim |
13:00:42 | dom96 | shashlick, do you know what OS/arch this user is on? |
13:00:50 | shashlick | Everything is statically linked with nimarchive, maybe we need an older libc or musl, I don't know |
13:01:50 | * | zacharycarter quit (Ping timeout: 265 seconds) |
13:03:04 | dom96 | would be strange if this is a libc issue |
13:03:14 | dom96 | I would expect an outright crash then |
13:03:20 | dom96 | but maybe there is some weirdness possible here too |
13:04:02 | * | Senketsu joined #nim |
13:04:47 | shashlick | They mentioned Linux amd64 that's it |
13:05:34 | shashlick | If the wrapper was bad, it would fail consistently |
13:05:36 | dom96 | yeah, we need more info. The Linux distro and version for example |
13:05:54 | dom96 | if all else fails we can ask for ssh access to their machine |
13:06:03 | shashlick | I couldn't repro locally |
13:06:46 | * | solitudesf joined #nim |
13:07:20 | shashlick | Like the damn nimterop issue on osx with 1.2.0 and devel, consistently segfaults on Travis with no stack trace but works fine locally |
13:07:51 | * | opi quit (Quit: WeeChat 1.6) |
13:08:56 | * | hax-scramper joined #nim |
13:11:13 | dom96 | shashlick, is that still a problem? AFAIK you can at least grab the same docker images that Travis uses and/or maybe even ssh into Travis, although that may require paying them |
13:12:08 | * | opi joined #nim |
13:12:21 | shashlick | Can you do that for osx as well? |
13:12:42 | shashlick | I've used the Linux image in the past successfully |
13:13:03 | dom96 | I've never done it, but there must be a way. We can't be the only ones having such problems. |
13:13:20 | shashlick | I'll dig around |
13:13:36 | disruptek | livcd: chronos does not work with arc. |
13:13:46 | shashlick | Would you mind running nimble test on nimterop head? You have osx right? |
13:17:59 | * | opi quit (Changing host) |
13:17:59 | * | opi joined #nim |
13:20:14 | * | tane joined #nim |
13:20:28 | * | Guest44318 is now known as dadaad |
13:20:29 | * | dadaad is now known as dadada |
13:20:48 | * | disruptek is now known as dadasdad |
13:20:57 | dadada | why does https://play.nim-lang.org/#ix=2ioH output foo, echo bar echo foo |
13:21:09 | dadada | instead of foo: echo bar echo foo |
13:21:43 | dom96 | shashlick, supposed to be doing non-hobby work right now, but I'll get to that in the evening, just remind me in around 6 hours. |
13:22:06 | dadada | I'm looking for a way of getting the accurate original code for a NimNode |
13:23:26 | dadada | args.toStrLit.strVal gives the same result here |
13:23:27 | * | Spy653 quit (Quit: Connection closed for inactivity) |
13:23:49 | dadasdad | node.repr |
13:24:20 | solitudesf | you cant |
13:24:27 | dadada | dadasdad: that's what I used, you should have looked first, but your nick is splendid |
13:25:10 | dadasdad | once the code is parsed, it's in a new format. you can render it but you cannot recover the original string. |
13:25:49 | * | tane quit (Quit: Leaving) |
13:25:52 | * | Senketsu quit (Quit: WeeChat 2.7) |
13:26:18 | dom96 | yeah, the rendering isn't perfect either (fixing these would be appreciated) |
13:26:35 | dadada | nodes keep their original line/col in the lineinfo object, all that's missing is that the lineinfo object also keeps the original finalline/finalcolumn, and then it would be easy to extract from the sources, if needed |
13:27:43 | * | Senketsu joined #nim |
13:27:55 | solitudesf | your complaint is about comma/column, which arent a part of any NimNode so thats irrelevant |
13:33:38 | * | Senketsu quit (Quit: WeeChat 2.7) |
13:34:25 | * | zacharycarter joined #nim |
13:35:01 | * | Senketsu joined #nim |
13:36:16 | * | Senketsu quit (Client Quit) |
13:37:20 | * | clyybber joined #nim |
13:39:01 | * | zacharycarter quit (Ping timeout: 258 seconds) |
13:41:25 | clyybber | Araq: How should we treat tuples of vars? |
13:41:45 | clyybber | Since mutability is not part of a type normally they are a bit tricky |
13:41:47 | * | Senketsu joined #nim |
13:42:24 | clyybber | My first intuitive guess would be that they should only be allowed as return types/rvalues |
13:45:35 | * | xcm quit (Remote host closed the connection) |
13:49:09 | * | xcm joined #nim |
14:04:01 | FromDiscord | <mratsim> var tuple as return value have similar issues to var arrays as return value |
14:04:07 | FromDiscord | <mratsim> it crashes the compiler |
14:04:11 | FromDiscord | <mratsim> unless it's for iterators |
14:05:41 | clyybber | Yeah. Where are var arrays as return values used? |
14:05:48 | clyybber | Or allowed/working rather |
14:06:23 | * | Senketsu quit (Quit: WeeChat 2.7) |
14:07:53 | livcd | disbot: so no async works with arc atm gotcha! |
14:08:50 | * | opi quit (Quit: Leaving) |
14:09:04 | FromDiscord | <clyybber> @mratsim ping |
14:09:53 | FromDiscord | <clyybber> Do you mean returning arrays of vars? What would that be useful for? |
14:11:36 | * | dadasdad is now known as disruptek |
14:11:55 | disruptek | livcd: async works with arc, it just leaks memory. |
14:12:11 | * | zacharycarter joined #nim |
14:12:22 | disruptek | i run all my async code in a thread, anyway. solves the many problems i have with async. |
14:12:38 | * | opi joined #nim |
14:14:03 | disruptek | i thought var tuples are fixed now. cooldome closed my issue. |
14:14:26 | clyybber | disruptek: Oh hey you're back! |
14:14:32 | disruptek | sup dawg |
14:14:42 | companion_cube | I still need to get back to openapi |
14:15:22 | disruptek | are you the one that filed an issue for v3? |
14:15:25 | * | Senketsu joined #nim |
14:15:55 | companion_cube | yep |
14:16:25 | disruptek | ah, cool. |
14:16:31 | * | Senketsu quit (Client Quit) |
14:16:46 | * | endragor quit (Remote host closed the connection) |
14:16:51 | disruptek | did you see that the schema is contained in a schema2 file or w/e? |
14:17:27 | companion_cube | it's encoded in nim constructs, right? |
14:17:31 | companion_cube | (I did see the file) |
14:17:37 | disruptek | yeah. |
14:17:57 | clyybber | IMO the way to fix this date time issue is to make `var a: DateTime` equal `var a = default(DateTime)` |
14:18:53 | disruptek | yes, but we're just using datetime as a proxy for all reqinit objs, right? |
14:19:00 | clyybber | Which Yeah |
14:19:06 | clyybber | d/Which |
14:19:26 | disruptek | i want an operator for that. |
14:19:34 | disruptek | ?mydate |
14:19:50 | clyybber | What would it do? |
14:20:01 | disruptek | x == default(x) |
14:20:05 | clyybber | Ah |
14:20:19 | * | nsf quit (Quit: WeeChat 2.8) |
14:20:58 | disruptek | x != default(x) i guess. |
14:21:19 | disruptek | tricky. maybe it cannot be unary. |
14:21:36 | disruptek | ?+ and ?- maybe. |
14:21:46 | FromDiscord | <treeform> Is there a way to get current modules path, or main module path during compile? I want to compile in the path it was compiled from. |
14:21:50 | clyybber | Why can't it be unary? |
14:22:01 | clyybber | I thought every op can be unary |
14:22:05 | clyybber | Maybe I'm wrong |
14:22:12 | disruptek | because it's confusing. |
14:22:25 | disruptek | treeform: sure; using the compiler's config. |
14:22:38 | disruptek | see nimph/src/nimph/config.nim |
14:22:51 | clyybber | I think there is currentSourcePath or something like that no? |
14:22:58 | clyybber | That points to the current module |
14:23:24 | FromDiscord | <treeform> yes thanks currentSourcePath |
14:23:27 | disruptek | i think the project path isn't well-propogated. |
14:23:56 | disruptek | i jump through a ton of hoops to figure this out in bump. |
14:24:22 | clyybber | Yeah, but when doing it in your own project its simpler |
14:24:27 | clyybber | Since you know where the file is |
14:24:29 | disruptek | also, shashlick added some way to query the compiler for an arbitrary options list. |
14:25:54 | FromDiscord | <mratsim> @clyybber it would be useful for big integers |
14:26:17 | FromDiscord | <mratsim> you often work on half/half an array to implement multiplication and division |
14:27:12 | FromDiscord | <mratsim> this requires being able to split a bigint in 2: https://github.com/status-im/nim-stint/blob/master/stint/private/uint_div.nim#L123-L169 |
14:27:43 | FromDiscord | <clyybber> The issue with this is that it conflicts with nims way of not attaching var to the type |
14:27:56 | FromDiscord | <clyybber> So ptr would be more appropriate there I think |
14:29:06 | FromDiscord | <clyybber> If I understood your right you meant to use `array[2, var array[...]]` right? |
14:29:19 | FromDiscord | <mratsim> well not even |
14:29:35 | zacharycarter | is there a way for to choosenim to list the current toolchain directory? |
14:30:01 | FromDiscord | <mratsim> I would like to be able to do `proc lo[N, uint64](x: array[N, uint64]): var array[N div2, uint64]` |
14:30:23 | FromDiscord | <clyybber> Ah, gotchu |
14:30:27 | FromDiscord | <mratsim> see bug: https://github.com/nim-lang/Nim/issues/8053 |
14:30:54 | FromDiscord | <clyybber> Okay, thats a codegen bug |
14:31:05 | FromDiscord | <mratsim> ah it was closed |
14:31:08 | FromDiscord | <mratsim> I missed that |
14:31:11 | FromDiscord | <mratsim> have to retry |
14:31:12 | FromDiscord | <clyybber> Yeah π |
14:32:25 | disruptek | when did this datetime issue arrive? |
14:32:31 | disruptek | !issue datetime |
14:32:32 | disbot | https://github.com/nim-lang/Nim/issues/11081 -- 3DateTime field on Exception produces inconsistent C/++ handling 7& 29 more... |
14:32:42 | disruptek | not that one. |
14:33:53 | disruptek | #14002 |
14:33:54 | disbot | https://github.com/nim-lang/Nim/pull/14002 -- 3fix https://github.com/nim-lang/RFCs/issues/211: `var a: DateTime` compiles and is usable |
14:34:29 | disruptek | whatever changed actually broke working code i had. |
14:34:55 | clyybber | But its not merged? |
14:35:13 | disruptek | i mean, i cannot build disbot in 1.2. |
14:35:16 | clyybber | Oh |
14:35:23 | clyybber | Because of DateTime? |
14:35:26 | disruptek | yeah. |
14:35:46 | clyybber | I thought this issue has existed since forever |
14:36:04 | zacharycarter | Question - https://github.com/nim-lang/Nim/blob/devel/lib/system/threads.nim#L148 - shouldn't that also check to ensure that `nimV2` isn't defined? |
14:36:24 | zacharycarter | `nimV2` = `--gc:arc` correct? |
14:39:33 | disruptek | there's a better define. |
14:39:41 | zacharycarter | what is that? |
14:39:51 | dom96 | IIRC nimV2 is something else |
14:40:01 | clyybber | Nope nimV2 is essentially gc:arc |
14:40:05 | disruptek | it's in alloc.nim iirc. |
14:40:27 | zacharycarter | well regardless - shouldn't that check include checking for arc? |
14:40:42 | clyybber | Not sure, why would it? |
14:41:07 | zacharycarter | because if it doesn't it's going to execute `nimGC_setStackBottom` and `initGC` etc |
14:41:17 | zacharycarter | we don't want that to happen in the case we're using `arc` correct? |
14:41:20 | clyybber | Oh, yeah then it probably should :D |
14:41:23 | zacharycarter | :D |
14:41:42 | zacharycarter | okay I will try to find a better suited define in alloc.nim and then PR |
14:41:45 | leorize | nimV2 is --seqsv2 iirc |
14:43:01 | disruptek | gcDestructors |
14:43:51 | disruptek | technically, #11081 is consistent now. |
14:43:52 | disbot | https://github.com/nim-lang/Nim/issues/11081 -- 3DateTime field on Exception produces inconsistent C/++ handling ; snippet at 12https://play.nim-lang.org/#ix=20PX |
14:44:03 | zacharycarter | `gcarc` is it I guess |
14:44:04 | disruptek | all three examples fail to compile due to uninit datetime. |
14:44:49 | disruptek | not gcDestructors? |
14:45:08 | zacharycarter | https://github.com/nim-lang/Nim/blob/9c46927fad6535cf7e172f5af5e93d179cec1020/compiler/commands.nim#L494-L504 |
14:45:11 | clyybber | leorize: Yeah, optSeqDestructors implies nimV2 |
14:45:23 | clyybber | And so does optOwnedRefs |
14:45:31 | leorize | zacharycarter: https://github.com/nim-lang/Nim/blob/352232e62dea88191339af3aaa943cb93fb4db02/lib/system/gc_interface.nim#L3 |
14:45:34 | leorize | fix that instead |
14:45:37 | disruptek | oh, i see; it's both. π |
14:46:02 | leorize | hmm, it already disabled that code path |
14:46:04 | zacharycarter | leorize: what needs fixing there? I'm dumb - please explain more |
14:46:06 | clyybber | disruptek: lol :D |
14:46:24 | leorize | zacharycarter: look at the when you referred to |
14:46:30 | leorize | it has `not usesDestructors` |
14:46:38 | zacharycarter | oh so add gcarc there |
14:46:51 | leorize | gcDestructors has already been added there |
14:47:07 | disruptek | just PR the removal of one of the names. |
14:47:08 | leorize | that code path is already disabled on arc |
14:47:14 | zacharycarter | gotcha |
14:47:20 | zacharycarter | so nothing needs fixing - good |
14:47:53 | zacharycarter | just trying to hunt down what's causing this thread error and why it only happens in the c backend and not the cpp backend |
14:48:08 | disruptek | probably exception-related. |
14:48:36 | zacharycarter | okay good to know that |
14:48:57 | dadada | does Nim have any generalized wasy of distinguishing specific kinds of types? ie. int, int8, Natural, are all useful for counting stuff (countables?); seq[foo], array, tables, ..., are all containers/collections (enumerables/collections); I'm asking this because this would help me with writing a template that takes two arguments, where one argument is the former category and the second is in the latter one |
14:49:03 | dadada | s/wasy/way |
14:49:30 | disruptek | int or int8 |
14:49:33 | clyybber | Ordinal for the first |
14:49:38 | narimiran | dadada: Ordinal |
14:49:53 | clyybber | And for the latter there is none. Concepts are probably what you want |
14:49:55 | dadada | okay, thanks so there's one :-) |
14:50:05 | clyybber | Or unbounded generics |
14:50:12 | disruptek | oh, i thought you were asking about typeclasses. |
14:50:42 | companion_cube | disruptek: I'm new to nim, why is nimph a separate thing from nimble? |
14:51:07 | disruptek | because its approach is so fundamentally different. |
14:51:33 | dadada | I'd like to do something like template myTempl(ord: Ordinal, e: Enumarable) # I think in C# they call it Enumarable |
14:51:59 | companion_cube | because of lockfiles? |
14:52:30 | disruptek | no; nimble asserts environment while nimph merely vets it. |
14:53:17 | disruptek | if you look at the code, i've added {.warning: "this needs implementing to warn of foo".} in the doctor. |
14:53:38 | disruptek | there's a lot more that we know about the environment and can teach the user about. |
14:53:58 | companion_cube | hmmmmmmm |
14:54:31 | disruptek | what language are you coming from? |
14:54:50 | companion_cube | OCaml mostly |
14:54:53 | zacharycarter | Yardanico: I don't think this comment is accurate - https://github.com/nim-lang/Nim/issues/13935#issuecomment-614271961 |
14:54:54 | disbot | β₯ SIGSEV encountered when creating threads in a loop w/ --gc:arc ; snippet at 12https://play.nim-lang.org/#ix=2ioe |
14:55:04 | zacharycarter | I tried the commit you said is working, and it's not |
14:55:31 | leorize[m] | disruptek: I need some help on this: https://github.com/nim-lang/nimble/pull/768#issuecomment-611113450 |
14:55:32 | disbot | β₯ nimscript{wrapper,api}: don't copy generated script to package directory |
14:56:20 | disruptek | you can forge your location and run the compiler's config parsing. |
14:56:47 | leorize | yea but nimble don't link to the compiler |
14:57:03 | disruptek | oh, i forgot. |
14:57:18 | disruptek | you're basically screwed. |
14:58:12 | disruptek | maybe i don't understand the use-case, though. |
14:58:29 | dom96 | leorize: I was going to suggest a compile change to make this possible. |
14:58:32 | dom96 | *compiler |
14:59:34 | disruptek | you cannot run the nimscript from the package directory? |
14:59:37 | * | opi quit (Ping timeout: 264 seconds) |
15:01:15 | * | leorize[m]1 joined #nim |
15:01:18 | leorize[m] | if I can this PR wouldn't be there :P |
15:01:56 | disruptek | no; chdir package-dir; nim e /some/script/elsewhere.nims |
15:02:24 | dom96 | imports break then |
15:02:28 | leorize | already did, the compiler still won't parse the configs |
15:02:46 | disruptek | ah; it thinks the project dir is where the script is located. |
15:02:51 | leorize | yea |
15:03:01 | disruptek | can you pass that as an override in the command-line? |
15:03:35 | leorize | nope, you can't |
15:03:42 | disruptek | shit, really? |
15:03:53 | leorize | the compiler isn't really geared for scripting, yet |
15:03:59 | disruptek | hey, let's stream it. |
15:05:08 | disruptek | just have to merge obs. |
15:06:37 | leorize | I think we'd want something along the lines of: `nim e --realScript:/path/to/nims file.nimble` |
15:07:55 | dom96 | you may want to get Araq's approval first |
15:08:24 | disruptek | ~stream |
15:08:24 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
15:09:09 | * | oculux joined #nim |
15:10:50 | leorize | disruptek: project .nims file will be run along side the .nim file |
15:11:23 | * | opi joined #nim |
15:11:47 | leorize | check twitch chat lol |
15:14:45 | dadada | why is the len proc not documented for sets like it is for strings/seqs? https://nim-lang.org/docs/system.html#system-module-sets |
15:15:10 | leorize | it's just an alias for `card` |
15:15:11 | dadada | I mean, in this table, it might be somewhere else, but in this table it looks like you'd have to use card instead |
15:15:56 | leorize | yea, the right term is `card`. it's a set, and a set don't have a length |
15:15:56 | FromDiscord | <mratsim> @dadada, len is new, less than a year old |
15:16:28 | disruptek | that's my fault. |
15:16:32 | FromDiscord | <mratsim> the rational is that `len` is for O(1) but for a set you need to iterate on the set to get the number of elements contained |
15:16:37 | disruptek | i added len and didn't add it everywhere in the docs. |
15:16:45 | disruptek | len is an alias. |
15:17:08 | FromDiscord | <mratsim> well before you added it, it wasn't there because of the reason I explained |
15:17:18 | dadada | suppose you're new to Nim, you look at the sets table and compare it to the seq table, you're likely to conclude that there's no len for sets, because you rightly expect there to be consistency in documentation, and if there's len documented for seq and not for sets, you'd expect that to accurately reflect the way things are |
15:17:22 | * | silvernode joined #nim |
15:17:23 | FromDiscord | <mratsim> in-between counting set elements was changed to popcount instead of testing bit by bit |
15:17:51 | FromDiscord | <mratsim> sure |
15:18:04 | disruptek | the idea of len() is not to differentiate from card() semantically; it's to enable the same code to be written against sets and seqs. |
15:18:27 | FromDiscord | <mratsim> yes, but in the past len for sets was very slow |
15:18:30 | disruptek | what it means is, how many elements are in this collection. |
15:18:56 | leorize | I don't even think speed is something that we concern ourselves with the API |
15:19:00 | dadada | disruptek: yeah, exactly why I need len for sets now, and then I looked it up in the docs, was disappointed, tried len on sets nevertheless, and then I didn't know whether it is deprecated or not (thought that may be the reason for it not being in the docs) |
15:19:06 | leorize | iirc even linked list have `len` |
15:19:15 | disruptek | nope, they don't. |
15:19:26 | disruptek | i thought about adding it, though. |
15:19:48 | leorize | btw check twitch chat again |
15:19:48 | FromDiscord | <mratsim> there was some discussion I don't know where, were we didn't want to have a len for set because it would automatically make an user algorith O(n^2) if called in a loop and it was assumed to be like seq.len |
15:19:50 | zacharycarter | disruptek - I think you were right, looks like this commit broke threading for `--gc:arc` and the C target |
15:19:54 | zacharycarter | c3344862b0d6061cc1581f29c81b29b75c78615 |
15:20:02 | zacharycarter | which is - --exception:goto switch for deterministic exception handling (#12977) |
15:20:03 | disbot | https://github.com/nim-lang/Nim/pull/12977 -- 6--exception:goto switch for deterministic exception handling |
15:20:53 | disruptek | mratsim: it makes sense. i hate it, too. |
15:21:07 | disruptek | maybe we just issue a warning. |
15:21:38 | disruptek | i mean, it's really not on us to explain the complexity of every algo in the stdlib. |
15:21:47 | leorize | zacharycarter: try --gc:arc --exceptions:setjmp |
15:21:53 | zacharycarter | okay |
15:21:56 | leorize | if that works, then the bug is in --exceptions:goto |
15:22:07 | disruptek | we have to be able to provide slow-but-useful algos as well as fast ones. |
15:22:25 | FromDiscord | <mratsim> @disruptek, with the popcount implementation it's fine |
15:22:47 | zacharycarter | leorize: yeah `--exceptions:setjmp` works :D I'll add that to my comment in the issue |
15:22:56 | FromDiscord | <mratsim> a popcount is as fast as retrieving the data from memory |
15:23:15 | dom96 | disruptek, documenting the complexity would certainly be helpful |
15:23:26 | FromDiscord | <mratsim> well base data structures need to be reasonably fast |
15:23:27 | disruptek | i get it. |
15:23:39 | disruptek | i hadn't read your popcount comment. |
15:23:49 | leorize[m] | https://github.com/nim-lang/Nim/blob/devel/compiler/bitsets.nim#L99 |
15:23:59 | leorize[m] | pretty sure it's not implemented like that atm |
15:24:14 | FromDiscord | <mratsim> isn't that just for compile-time? |
15:24:25 | FromDiscord | <mratsim> pretty sure I saw a PR from @narimiran on that |
15:25:05 | FromDiscord | <mratsim> otherwise that's bad |
15:26:11 | leorize | ah, I see it |
15:26:14 | leorize | lib/system/sets.nim |
15:26:43 | leorize | it's not popcnt though |
15:27:56 | FromDiscord | <mratsim> still much better than looping on each bits |
15:28:13 | FromDiscord | <mratsim> and the length is 1 or 2 since we can store uint16 at most in a bitset |
15:28:58 | * | couven92 quit (Ping timeout: 256 seconds) |
15:29:15 | * | narimiran quit (Ping timeout: 265 seconds) |
15:30:07 | * | Trustable joined #nim |
15:35:08 | Araq | mratsim: problem is the slow loop is O(1) still ;-) |
15:35:27 | Araq | sometimes CS theory is a failure |
15:36:07 | leorize | Araq: what do you think about the `--realScript` idea above? |
15:36:59 | * | silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
15:37:25 | Araq | I rarely read the logs |
15:37:55 | leorize | it's something like this: `nim e --realScript:/path/to/nims project.nimble` |
15:38:19 | Araq | everything that improves Nimble is fine with me |
15:38:40 | Araq | still need to write my RFC about nuking Nim's config system .... :P |
15:38:49 | dom96 | oh really |
15:38:55 | leorize | lol I'm adding this to make nimble work with the config system |
15:39:01 | leorize | you can't just nuke it like that |
15:39:04 | dom96 | I'll put that on a poster and start writing PRs for the compiler then :P |
15:40:02 | Araq | dom96: be my guest, I'm not hostile to PRs. I'm hostile to PRs that fix X while at the same time change Y and then remove Z because the OP doesn't like Z |
15:42:00 | dom96 | Araq, a while ago you were really against me changing anything in the compiler for the sake of Nimble. |
15:42:01 | FromDiscord | <0ffh> hi, sorry noob question: what was the keyword top have something execute (like closing file for cleanup, etc) when leaving scope? |
15:42:07 | * | narimiran joined #nim |
15:42:13 | dom96 | Araq, by "a while ago" I mean years ago of course :) |
15:42:20 | leorize | 0ffh: `defer` |
15:42:22 | Araq | I also don't understand your point. iirc we introduced the whole nimbleDir feature for Nimble |
15:42:24 | FromDiscord | <0ffh> thx |
15:42:34 | * | liblq-dev quit (Ping timeout: 240 seconds) |
15:43:01 | Araq | dom96: yet the better *design* is often the result of making the Nim compiler unaware of Nimble |
15:43:05 | leorize | can we eventually get rid of nimbleDir? :P |
15:43:09 | dom96 | Araq, fair enough, you allowed that. |
15:44:32 | dom96 | leorize: sure, what will we replace it with? |
15:44:58 | leorize | configuration files for package manager |
15:45:12 | leorize | nimph use that and it works well |
15:45:20 | disruptek | what do you need a config file for? |
15:45:31 | dom96 | you mean *for Nim* not for the package manager? |
15:45:34 | FromDiscord | <mratsim> we use NIMBLE_DIR extensively to make nimble compatible with our submodules system |
15:46:07 | FromDiscord | <mratsim> and not pollute our own personal repo |
15:46:07 | * | zacharycarter quit (Ping timeout: 250 seconds) |
15:46:30 | FromDiscord | <mratsim> i.e. in our work environment "export NIMBLE_DIR=vendor/.nimble" |
15:46:43 | FromDiscord | <mratsim> and then we're good |
15:47:12 | dom96 | mratsim: I think leorize is referring to something else |
15:47:22 | dom96 | i.e. the --nimbleDir switch supported by the compiler |
15:47:34 | leorize | afaict the idea of `nimbledir` is so that you don't have to use a `cfg` file to point the compiler to the actual packages |
15:48:20 | leorize | you can just use a cfg file that do `for i in walkDir(nimblepath): switch "path", i` |
15:48:58 | dom96 | so you want Nimble to generate a cfg file which the compiler can then read |
15:49:12 | dom96 | Right now Nimble generates a .nims file, so that the compiler can read it |
15:49:15 | dom96 | and you're working to fix that |
15:49:16 | dom96 | :P |
15:49:22 | dom96 | Can you see the irony? :) |
15:50:02 | leorize | the compiler is chasing nimble :P |
15:50:29 | * | tane_ joined #nim |
15:51:48 | Araq | nimble generating the .nims file to run seems to me the best way to do it, what's wrong with it? |
15:52:14 | Araq | shashlick did a terrific job on that. |
15:52:31 | leorize | disruptek: does nimph work with Nim's `pkg` import prefix? |
15:52:55 | disruptek | if it works in nim it works in nimph, afaik. |
15:53:21 | * | fputs joined #nim |
15:53:30 | leorize | i think the pkg import prefix requires --nimbledir to be configured |
15:53:31 | disruptek | nimph doesn't express the environment except in ways that the nim compiler reads the environment. that's how they communicate. |
15:53:58 | FromDiscord | <mratsim> sometimes I accidentally commit the ".nims" file generated π |
15:54:08 | dom96 | mratsim: :'( |
15:55:46 | FromDiscord | <mratsim> https://github.com/mratsim/constantine/pull/24/commits/47bc4289381eb3bbbe7d2c1a1b9dee96891e7875 |
15:55:47 | disbot | β₯ Initial support for Elliptic Curve |
15:57:38 | * | chemist69 quit (Ping timeout: 256 seconds) |
15:58:35 | * | chemist69 joined #nim |
16:01:23 | * | narimiran quit (Ping timeout: 260 seconds) |
16:10:09 | * | narimiran joined #nim |
16:15:50 | Araq | sounds like a job for a better gitignore |
16:16:50 | dom96 | Yeah, say what you will but I personally dislike having dozens of these files and needing to remove them manually |
16:17:27 | dom96 | Maybe that's a bug and Nimble should be removing them, but since it's still happening the best way to ensure it stops happening is to stop generating these files. |
16:22:31 | * | liblq-dev joined #nim |
16:23:14 | clyybber | Araq: What do you think about this: https://irclogs.nim-lang.org/17-04-2020.html#13:41:25 ? |
16:24:41 | shashlick | Why lot a flag to specify explicit project path to Nim |
16:24:42 | * | narimiran quit (Remote host closed the connection) |
16:25:05 | shashlick | So it will load imports and cfg files even though the nim or nims file is elsewhere |
16:25:19 | shashlick | But nothing generic about that |
16:27:37 | * | xcm quit (Remote host closed the connection) |
16:29:45 | * | xcm joined #nim |
16:33:43 | * | narimiran joined #nim |
16:34:59 | * | couven92 joined #nim |
16:38:55 | Araq | dom96: huh? for me they are deleted |
16:39:07 | Araq | or maybe they are stored where I don't notice :P |
16:39:20 | leorize | they're deleted unless nimble crashes |
16:39:32 | leorize | or if you run an old nimble that doesn't have the bug fixed |
16:39:40 | shashlick | this is based on leorize's PR |
16:40:15 | Araq | clyybber: it's covered by our RFC regarding borrowing |
16:40:19 | shashlick | he avoids the copy altogether and makes imports work |
16:40:19 | Araq | at least it should be |
16:40:26 | shashlick | but cfg files get missed |
16:40:45 | shashlick | it would be cool if we could override the project dir - wondering what other use cases it will benefit to make it worthwhile |
16:40:59 | Araq | well here is my idea once again: |
16:41:38 | * | audiophile joined #nim |
16:41:38 | Araq | the config should only be concerned with user specific or machine specific settings (like which C compiler to use or whether you like colors in the compiler's output) |
16:41:53 | Araq | everything else should be done inside the .nim file via pragmas |
16:42:00 | Araq | for two reasons: |
16:42:02 | Araq | - simplicity |
16:42:08 | audiophile | :D |
16:42:14 | Araq | - composability |
16:42:25 | Araq | in fact, inside a Nimble package only pragmas really work |
16:42:38 | Araq | as the package config is simply ignored altogether |
16:42:56 | Araq | (the Nim compiler does it this way since forever) |
16:42:59 | audiophile | any idea when competitive programming websites will add support for nim? or is that something we have to request? |
16:43:15 | leorize | Araq: --path is a popular one that people use |
16:43:43 | Araq | leorize: yeah |
16:44:02 | Araq | --path is an open problem but a .path pragma sounds feasible |
16:44:25 | shashlick | i like that cfg files for packages are ignored |
16:44:40 | shashlick | but i do agree pragmas for everything possible in cfg files is very useful |
16:44:57 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
16:45:18 | disruptek | ugh .path sounds bad. |
16:45:30 | shashlick | but what about all the legacy cfg files out there |
16:45:51 | Araq | shashlick: we support them for another decade but phase them out |
16:46:01 | shashlick | i'm on board with that idea |
16:46:05 | clyybber | Araq: Yeah, I don't really refer to the safety of that feature, just that it introduces var to the type system, because we then have tuple[var int, var int] for example. |
16:46:14 | shashlick | i'd really like a {.define.} |
16:46:25 | Araq | shashlick: we have it, check it out on devel |
16:46:38 | shashlick | peace |
16:46:43 | Araq | clyybber: it's an old feature though, how else would 'mitems' and 'mpairs' work? |
16:46:54 | clyybber | Yeah, I am aware |
16:47:01 | * | narimiran quit (Ping timeout: 264 seconds) |
16:47:15 | clyybber | I'm just thinking about how it fits into the type system |
16:47:26 | clyybber | And how it fits with view/lent/var |
16:47:35 | Araq | well it's a type. |
16:47:43 | Araq | so that's how it fits :P |
16:47:43 | shashlick | okay but are there other cases where overriding the project dir would be useful |
16:47:49 | clyybber | Because in theory having an object field thats a view into some array isn't too crazy either |
16:48:22 | clyybber | Araq: Heh, ok so do we want to support object[field: var int] ? |
16:48:46 | Araq | clyybber: yeah, every type that contains lent/var becomes a "borrowing" type |
16:49:02 | leorize | if `var type` becomes first class can we get rid of `byaddr`? :P |
16:49:07 | shashlick | leorize how did you fix the import issue with your PR |
16:49:07 | clyybber | Ah okay. That makes sense |
16:49:17 | leorize | shashlick: --path |
16:49:18 | Araq | and a borrowing type must be derived from the first parameter yada yada |
16:49:26 | shashlick | yep |
16:49:28 | clyybber | Or we use that from syntax? |
16:49:32 | Araq | leorize: yes |
16:49:41 | Araq | clyybber: yes, as a later extension |
16:49:44 | clyybber | But yeah, first parameter is good enough for now |
16:49:54 | shashlick | the thing i still don't like is that we need to prepend text to the nimble file for it to work |
16:50:10 | shashlick | would be cool to tell nim here's two nim files, put them together and run it as one |
16:50:16 | leorize | shashlick: in fact I can now generate `include file.nimble` instead of copying the content |
16:50:26 | leorize | still won't make the configuration parses though |
16:50:28 | Araq | leorize: I think we need 'var x = byvar(y)' instead of .byaddr |
16:50:38 | leorize | yea |
16:50:44 | Araq | but we can always map .byaddr to the new, better implementation |
16:50:53 | Araq | which is why I accepted it. |
16:51:16 | leorize | I'm still waiting for first-class borrowing :P |
16:51:34 | Araq | don't wait for it, implement it |
16:51:48 | leorize | I'm working on some other things |
16:52:07 | Araq | fair enough |
16:52:10 | leorize | it's harder than I expected to make sure that the GC is not touched, at all in a code path |
16:52:38 | Araq | well you use --gc:arc and there you go |
16:53:09 | leorize | if I'm gonna implement an alternative `osproc`, I want it to work everywhere |
16:53:41 | leorize | can't have users if I can't get it to work without --gc:arc |
16:54:26 | Araq | ah I see your problem. |
16:54:34 | Araq | still there is GC_disable/enable |
16:56:58 | dom96 | Araq, so in each module I would need multiple {.path.} pragmas? |
16:57:06 | dom96 | how would this work? |
16:57:43 | clyybber | Araq: Another thing regarding default fields (since its required to fix the DateTime issue properly), I think I'll do the transformation in transf.nim for now, as injectdestructors doesn't process VM code. But that means I can't optimize the unneccessary initializations away. |
16:57:51 | dom96 | How would you deprecate the global config files? |
16:58:00 | clyybber | So the question is, do we want to make the VM ready for injectdestructors? |
16:58:49 | clyybber | I feel like we must eventually, since people probably expect their custom destructors to be called for closing files and things like that |
16:59:31 | dom96 | I'm starting to think it may be a good idea to set up dedicated chat rooms for things like Nimble or maybe even specific Nim/Nimble feature/change proposals |
16:59:51 | dom96 | Otherwise it's just way too easy to lose context and get lost in the noise of other discussions |
17:01:14 | Araq | clyybber: yeah... the VM needs to run destructors, yay |
17:01:55 | Araq | dom96: well the config remains but we don't add more features to it |
17:02:20 | Araq | and we also see the pragma system is powerful enough so that you can avoid the config system altogether |
17:03:00 | shashlick | Araq: so you talking about deprecating .cfg files only, or .nims files getting autoloaded as well? |
17:05:16 | Araq | shashlick: both .cfg and .nims files are wrong... *cough* |
17:06:09 | Araq | .nims files had a good idea, use Nim instead of the undocumented .cfg file format |
17:06:34 | Araq | but the implementation is messed up and continues to cost development resources |
17:06:54 | Araq | it's very subtle that system.nim is actually processed twice |
17:06:58 | dom96 | based on user experiences, it seems that most user's expectations are that nim configuration should go into the .nimble file |
17:07:12 | dom96 | and I think that is the least surprising and might be worth pursuing |
17:07:22 | Araq | so here is a possible implementation, shashlick |
17:07:28 | disruptek | that's bananas. |
17:07:31 | dom96 | of course I know that Araq does not want everyone to use Nimble-by-default so this won't happen |
17:07:52 | Araq | disruptek: let me finish please and then you can raise your voice, ok? |
17:08:04 | disruptek | i'm responding to dom. |
17:08:06 | disruptek | but, sure. |
17:08:49 | Araq | inside system.nim at the end of it we have something like {.autoinclude: "globalconfig.nim".}; {.autoinclude: "$project.nims".} |
17:09:14 | Araq | and that's it, pragmas inside these autoinclude files do the configuration |
17:10:18 | Araq | so ok, these are my thoughts, now I'm ready to take your feedback |
17:10:36 | disruptek | mumble. |
17:10:42 | clyybber | I find deprecating .cfg a good idea |
17:10:44 | disruptek | ~stream |
17:10:44 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
17:11:05 | * | someunknownuser quit (Ping timeout: 240 seconds) |
17:11:13 | Araq | hmm ok |
17:11:48 | clyybber | About the other stuff, I don't know. In theory it seems like a cool way to solve the problem |
17:12:02 | clyybber | But nims files are also used to compile dependencies, right? |
17:12:15 | clyybber | Won't that break here? |
17:15:17 | clyybber | Maybe I misunderstood what you proposed |
17:15:51 | * | NimBot joined #nim |
17:18:00 | Araq | clyybber, discussions was moved to mumble... |
17:19:03 | clyybber | Okay |
17:19:04 | dom96 | That's a nice way to get a less noisy conversation :) |
17:19:19 | dom96 | as long as multiple people don't speak at once |
17:20:00 | Yardanico | no recordings though :( |
17:21:18 | supakeen | Mumble can be recorded of course if you'd want to. |
17:21:31 | shashlick | just jumped on so missed part of the discussion |
17:21:34 | supakeen | dom96: If it gets out of hand mumble offers a lot of things to ensure that doesn't happen :) |
17:21:58 | * | tane_ is now known as tane |
17:22:01 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
17:22:21 | disruptek | this is recorded. |
17:22:29 | disruptek | you can participate live or watch later. |
17:22:42 | dom96 | lol |
17:22:45 | dom96 | you should make that clear |
17:23:02 | disruptek | ~stream |
17:23:03 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
17:23:19 | Yardanico | disruptek: well doesn't twich remove all streams if you don't pay? |
17:23:24 | Yardanico | after a month I mean |
17:23:25 | disruptek | nope. |
17:23:26 | Yardanico | recording of the stream |
17:23:28 | disruptek | well, yes. |
17:23:38 | disruptek | if you need to know what happened here next month, i'll let you know. |
17:23:44 | supakeen | hehehe |
17:26:54 | opi | reading IRC channel over Twitch, heh |
17:27:08 | Yardanico | opi: you can connect to twitch from irc too btw |
17:27:55 | opi | Yardanico: I'm just a Nim lurker, so I did not expect to crash head on into *deep discussions* ;-) |
17:32:30 | Yardanico | ~mumble |
17:32:30 | disbot | no footnotes for `mumble`. π |
17:32:40 | leorize | ~stream |
17:32:40 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) |
17:32:45 | Yardanico | yeah |
17:33:27 | * | someunknownuser joined #nim |
17:44:13 | * | someunknownuser quit (Quit: someunknownuser) |
17:44:31 | * | someunknownuser joined #nim |
17:44:42 | FromDiscord | <treeform> PMunch, the 15GB of free memory is an interesting problem . The memory is "freed" for nim, but its not "freed" for the os. I can see some sort of system that goes, hey I have a GB of free memory, lets return it to the OS.... |
17:45:20 | FromDiscord | <treeform> Another solution could be that when allocating 100mb chunks of memory it would use system malloc and system free, by passing the free pool logic... |
17:47:04 | FromDiscord | <treeform> Avatarfighter, about UDP hole punching is code-wise pretty easy, but it requires servers to exist... its a system problem not a library problem. |
17:47:42 | FromDiscord | <treeform> faulander, I added a way to resize images, I don't know if you saw. |
17:55:41 | * | dddddd quit (Ping timeout: 250 seconds) |
17:57:11 | disruptek | shashlick: there's a newer fork/replacement for plumble iirc. |
17:57:21 | * | Lord_Nightmare joined #nim |
18:04:07 | * | narimiran joined #nim |
18:05:35 | Prestige | PMunch: didn't read all of your chat earlier, but I think having a "non-strict mode" for jsonschema would be a good idea |
18:09:10 | * | narimiran quit (Quit: leaving) |
18:13:34 | * | yumaikas quit (Ping timeout: 240 seconds) |
18:14:50 | * | zacharycarter joined #nim |
18:16:28 | * | shodan45 quit (Quit: No Ping reply in 180 seconds.) |
18:24:17 | * | waleee-cl joined #nim |
18:25:52 | * | shodan45 joined #nim |
18:30:37 | * | clyybber quit (Quit: WeeChat 2.8) |
18:31:34 | * | opi quit (Ping timeout: 240 seconds) |
18:34:23 | * | opal quit (Ping timeout: 240 seconds) |
18:38:06 | * | opal joined #nim |
18:39:39 | someunknownuser | Are methods currently supposed to work with --gc:arc? |
18:39:50 | Yardanico | someunknownuser: try it :P |
18:40:23 | someunknownuser | I am asking because I am having problems getting them to work properly |
18:40:50 | someunknownuser | In some cases the base methods are called instead of the overwritten ones |
18:43:07 | * | fputs quit (Quit: WeeChat 2.8) |
18:45:47 | Araq | someunknownuser, is that specific to --gc:arc? |
18:45:54 | someunknownuser | yes |
18:46:12 | Araq | then report it please, it's supposed to work, the impl was ported |
18:46:46 | someunknownuser | ok, I am trying to create a mininal example |
18:46:49 | FromDiscord | <Recruit_main707> are they on different files? |
18:47:36 | someunknownuser | yes |
18:47:57 | FromDiscord | <Recruit_main707> are you sure thats arc specific?? |
18:48:42 | FromDiscord | <Recruit_main707> and you are calling it from the first or second file? |
18:48:42 | someunknownuser | yes, but you can try for yourself. The project in question is on github: https://github.com/pseudo-random/editor |
18:49:10 | someunknownuser | calling from the file which defines the base methods |
18:49:29 | someunknownuser | that would be window_manager.nim |
18:55:59 | someunknownuser | when I rename the arguments to be the same as in the base method it seems to work |
18:56:32 | zedeus | damn, jester crashes with arc but asynchttpserver alone doesn't |
18:56:55 | FromDiscord | <Recruit_main707> Araq: is thats how its supposed to work?? |
18:57:49 | someunknownuser | even if it is how that is supposed to work, changing the gc should not affect method resolution imo |
19:00:46 | * | Vladar quit (Quit: Leaving) |
19:05:32 | * | opi joined #nim |
19:10:13 | * | opi quit (Ping timeout: 258 seconds) |
19:14:13 | * | Romanson quit (Quit: Connection closed for inactivity) |
19:16:22 | * | opi joined #nim |
19:23:23 | * | opal quit (Ping timeout: 240 seconds) |
19:24:51 | * | opal joined #nim |
19:32:36 | dadada | hmm, you can't access the sons of a NimNode directly, what I want to do is to add something to the beginning of a nnkCommand |
19:32:46 | dadada | there's add() for adding stuff to the end |
19:33:18 | dadada | of course I can create a new command NimNode, but that seems inefficient |
19:35:09 | disruptek | shashlick: might have reproduced the choosenim problem? https://api.travis-ci.org/v3/job/674719467/log.txt |
19:38:15 | * | Faulander is now known as Faulander|afk |
19:45:23 | * | opi quit (Quit: Leaving) |
19:50:27 | shashlick | that's the github API limit issue |
19:50:40 | disruptek | ah, cool. |
19:50:48 | shashlick | a pain nonetheless |
19:54:38 | * | nullwarp joined #nim |
20:01:30 | FromDiscord | <Varriount> Do we currently have a good, cross-platform way to dynamically allocate something on the stack? |
20:02:19 | leorize[m] | no, and please never do that |
20:02:44 | leorize[m] | dynamic stack allocation and cross platform is a recipe for disaster |
20:04:48 | leorize[m] | usually the best way would be to allocate a static chunk (ie. an `array[2048, char]`) then use parts of it as needed |
20:04:50 | FromDiscord | <Varriount> leorize: I should use recursion then? |
20:05:07 | leorize[m] | depends on what you're doing |
20:05:30 | FromDiscord | <Varriount> Path processing. Specifically collapsing `..` elements. |
20:05:38 | leorize[m] | though recursion is a kind of dynamic stack allocation, just a bit more structured |
20:07:34 | leorize[m] | I think a seq acting as a stack works here |
20:09:34 | FromDiscord | <Varriount> I guess. Seems like a waste to allocate something that will only store a couple of integers on the heap though. |
20:10:01 | * | yumaikas joined #nim |
20:10:22 | leorize | systemd devs thought so and they stack overflowed their stuff to oblivion :P |
20:10:33 | leorize | a big static array works too if you feel like it |
20:10:33 | FromDiscord | <Varriount> Good point. |
20:12:56 | * | leorize[m]1 left #nim ("User left") |
20:16:05 | leorize | a nim int is 8 bytes on a 64 bit machine |
20:16:38 | leorize | a typical path is usually < 256 char |
20:17:02 | leorize | so around 2kb of stack space for an array[256, int] |
20:17:13 | * | Tyresc joined #nim |
20:17:15 | FromDiscord | <SrMordred> Are nim incremental compilation working? iΒ΄m experimenting on windows and looks like it compiles eveything again even if nothing is change |
20:17:18 | leorize | should be affordable given how stack size are typically 2-4MB |
20:17:26 | companion_cube | gosh I read `8 bits` and was panicked for a second' |
20:18:09 | leorize | @Varriount: as an optimization I guess you can use this for path shorter than 256 char |
20:19:15 | leorize | of course the true optimization is to bring out SIMD and get position of all path seps simultaniously :P |
20:21:08 | leorize | but until someone create a lib that let you do low overhead runtime function selection based on processor I don't see SIMD getting used in generic library code anytime soon |
20:22:28 | * | ZoomZoomZoom joined #nim |
20:27:16 | * | tane quit (Quit: Leaving) |
20:33:48 | * | filcuc joined #nim |
20:39:14 | * | nullwarp quit (Remote host closed the connection) |
20:40:46 | * | endragor joined #nim |
20:46:08 | FromDiscord | <Generic> @SrMordred afaik there was some work on incremental compilation though it's not complete and currently paused |
20:46:18 | * | couven92 quit (Read error: Connection reset by peer) |
20:46:43 | leorize | disruptek is working on incremental compilation |
20:46:43 | * | couven92 joined #nim |
20:47:07 | FromDiscord | <SrMordred> @Generic oh, i thought that it was already working. thanks! |
20:50:12 | * | nullwarp joined #nim |
20:52:37 | * | someunknownuser quit (Quit: someunknownuser) |
20:57:57 | * | endragor quit (Remote host closed the connection) |
21:09:25 | FromDiscord | <Recruit_main707> how does incremental compilation work?? |
21:15:51 | PMunch | Prestige, yes but should it be the default? |
21:16:31 | Prestige | I think most have that set by default, so it may be implicitly expected by the end user of the lib |
21:16:40 | PMunch | treeform, it's a tough problem indeed.. And one that can't really be properly solved without either A moving memory or B having better control over memory (something that OSes don't provide unfortunately) |
21:17:12 | PMunch | A requires another level of indirection if it should be completely hidden from the caller though.. |
21:17:17 | Prestige | PMunch: before you go, let me PM you my pub key |
21:18:16 | * | couven92 quit (Read error: Connection reset by peer) |
21:18:39 | * | couven92 joined #nim |
21:35:14 | * | solitudesf quit (Ping timeout: 240 seconds) |
21:41:17 | * | PMunch quit (Quit: leaving) |
21:44:06 | * | liblq-dev quit (Quit: WeeChat 2.7.1) |
21:44:32 | FromDiscord | <Elegant Beef> So im currently playing around with xlib making a tiled window manager, and any clues how to manage createnotify messages? It seems some applications send more than one and the parent isnt set |
21:46:37 | Prestige | Elegant Beef: I'm doing the same currently, haven't gotten quite there yet though. Using this for a reference https://tronche.com/gui/x/xlib/ |
21:46:46 | FromDiscord | <Elegant Beef> Yea same |
21:47:17 | FromDiscord | <Elegant Beef> Nothing quite explains how to handle windows on created |
21:47:27 | FromDiscord | <Elegant Beef> A lot of what i see frames them but if i do that it just ends poorly |
21:47:57 | Prestige | I'm also using an existing wm in C as reference as well, if that will help you |
21:48:17 | Prestige | I'm about at the same step as you are |
21:49:37 | Prestige | https://github.com/avahe-kellenberger/dwm/blob/master/src/dwm.c the run function handles the events |
21:49:40 | FromDiscord | <Elegant Beef> I've looked at basic_wm and dwm |
21:49:57 | FromDiscord | <Elegant Beef> The C code is written so minimalistically it's hard for my tiny brain to follow |
21:50:03 | FromDiscord | <Elegant Beef> atleast in DWM |
21:50:37 | Prestige | It's been taking me some time to determine what some variable names stand for but I'm making progress |
21:51:16 | Prestige | I don't see dwm handling any createnotify events actually |
21:52:17 | FromDiscord | <Elegant Beef> IIRC it usues the map or other notify message to handle it |
21:52:20 | FromDiscord | <Elegant Beef> uses* |
21:52:33 | Prestige | Yeah |
21:53:10 | * | filcuc quit (Quit: Konversation terminated!) |
21:53:15 | Prestige | I'm away from my computer for another 30 mins but I'll let you know if I find anything when I'm back |
21:53:40 | FromDiscord | <Elegant Beef> Ok, idk about you but my plan is to use nimscript for customizing/widgets, and nuklear or cimgui for the default bar |
21:54:26 | FromDiscord | <Elegant Beef> The embeddedNimScript repo looks promising for this, since it can communicate from nims to nim and vice versa |
21:54:31 | Prestige | I'm probably going to not have a bar integrated in the WM, I'll make it a separate program |
22:00:11 | disruptek | !repo nuklear |
22:00:12 | disbot | https://github.com/zacharycarter/nuklear-nim -- 9nuklear-nim: 11Nim bindings for https://github.com/vurtun/nuklear/ 15 94β 8π΄ 7& 1 more... |
22:02:17 | shashlick | folks, appreciate feedback - made a big README update for https://github.com/nimterop/nimterop |
22:06:03 | * | dddddd joined #nim |
22:08:06 | FromDiscord | <Recruit_main707> ill read it now |
22:08:14 | * | Faulander|afk quit (Read error: Connection reset by peer) |
22:13:31 | Prestige | Elegant Beef: this might be useful https://tronche.com/gui/x/xlib/events/processing-overview.html |
22:28:52 | * | couven92 quit (Ping timeout: 256 seconds) |
22:31:54 | FromDiscord | <KingDarBoja> Hi guys |
22:32:23 | FromDiscord | <Elegant Beef> I just dont quite see which windows on created are important and which arent |
22:36:33 | FromDiscord | <KingDarBoja> That single tests that doesn't work on your suite and you have no idea why lol |
22:41:58 | Prestige | hm Elegant Beef do u know the difference between DefaultRootWindow and XDefaultRootWindow? |
22:42:11 | FromDiscord | <Elegant Beef> No |
22:47:21 | FromDiscord | <Recruit_main707> can you write some kind of program that reads c2nim errors and tries to fix them? (ie: put a `;` where it expects it and pray that works :P ) |
22:49:08 | FromDiscord | <KingDarBoja> I think I request some help on checking a module from Python source code vs my Nim approach |
22:49:19 | FromDiscord | <KingDarBoja> I think I will have to* |
22:52:25 | FromDiscord | <Recruit_main707> ask |
22:54:18 | FromDiscord | <KingDarBoja> Hold on, watching some anime OST right now |
22:54:30 | FromDiscord | <Recruit_main707> xD |
22:54:48 | FromDiscord | <KingDarBoja> SAIDO CHESTOOOO |
22:57:38 | FromDiscord | <exelotl> shashlick: I don't think it should link to "theindex". Not twice, and especially not as the first mention of links docs. It's a bad user experience x) |
23:00:36 | FromDiscord | <exelotl> *of links to docs |
23:01:24 | FromDiscord | <exelotl> the new readme content is good though! much better organised |
23:02:25 | FromDiscord | <Recruit_main707> Downloading https://github.com/alehander42/Nim using git may i ask why does this appear when running a nimble file? |
23:03:21 | * | D_ joined #nim |
23:06:37 | shashlick | exelotl: cool, ya theindex lists all modules, that's the only reason, but it isn't really the best |
23:09:17 | FromDiscord | <exelotl> I've accidentally clicked on it multiple times because it's the most promising-looking link on the page |
23:09:46 | shashlick | π |
23:11:53 | FromDiscord | <exelotl> One thing that I think is missing - as a newcomer, it needs to be explained somewhere early on, that the code in the readme goes into a file which *is* your wrapper, as in, you can import it in a real program and use it. |
23:15:05 | dadada | krux02: hey yo! mathAstFind would definitely be plenty useful! |
23:15:53 | krux02 | dadada, what is mathAstFind? |
23:16:08 | dadada | like you wrote in the discussion section of https://github.com/krux02/ast-pattern-matching/ |
23:16:11 | dadada | it's at the bottom |
23:16:32 | dadada | I assume you wrote that "A matchAstFind that would recursively search though the ast and stop at the first match would make sense. Here it would also be sane to use the else branch for the case that the entire ast does not have any match at all." |
23:16:38 | krux02 | Ah I remember now |
23:16:48 | krux02 | yes I wrote that |
23:16:53 | krux02 | a long time ago though |
23:17:14 | FromDiscord | <exelotl> shashlick: What I mean is, it's a small thing but I think the readme really needs to say what to *do* with the code. Because, initially, I was still in the mindset that I somehow need to run the code by entering some command or something |
23:18:07 | krux02 | dadada, yes that else branch is good |
23:18:27 | krux02 | I just don't get the time to implement it. |
23:18:41 | krux02 | I will probably implement it as needed. |
23:18:59 | dadada | ahm, I could use it right now :-() |
23:19:02 | dadada | :D |
23:19:24 | FromDiscord | <Recruit_main707> Languist (py2nim) seems to be outdated, does anyone know if itβs dead? |
23:19:46 | krux02 | ok fair point |
23:20:16 | krux02 | good to know that ast-pattern-matching is useful for you |
23:20:48 | krux02 | Recruit_main707: I am not even sure if py2nim is a sane projet to begin with. |
23:20:56 | dadada | stuff like is what separates Nim from the rest :D |
23:21:37 | krux02 | yea I use ast pattern matching in my opengl wrapper generator |
23:21:59 | krux02 | sorry I mean my nim to glsl compiler |
23:22:06 | FromDiscord | <Recruit_main707> krux02: py2nim now works with languist, (it just basically calls it) |
23:23:27 | shashlick | exelotl: will try to cover that better - also realize i didn't talk about command line as much - the -d:xxx stuff |
23:25:34 | * | Trustable quit (Remote host closed the connection) |
23:27:53 | dadada | so we have a walker for iterating/walking through a NimNode tree recursively? |
23:27:58 | dadada | s/so/do |
23:28:14 | dadada | I'm really not in the mood for rolling my own :-( |
23:41:34 | * | abm quit (Read error: Connection reset by peer) |
23:55:59 | * | krux02_ joined #nim |