00:12:35 | * | rockcavera joined #nim |
00:14:40 | * | krux02_ quit (Remote host closed the connection) |
01:11:50 | * | casaca quit (Remote host closed the connection) |
01:16:24 | * | endragor joined #nim |
01:16:49 | * | vicfred quit (Quit: Leaving) |
01:33:55 | * | casaca joined #nim |
01:40:59 | * | endragor quit (Remote host closed the connection) |
01:41:07 | * | endragor joined #nim |
01:48:34 | * | apahl quit (Ping timeout: 244 seconds) |
01:50:49 | * | apahl joined #nim |
02:03:00 | nisstyre | I have a C function that takes a pointer and a number of elements, which I want to wrap, is it safe/possible to cast an array to a pointer of that type? |
02:03:21 | nisstyre | I'm assuming yes as long as the number of elements is correct |
02:06:11 | FromDiscord | <Varriount> @nisstyre Yes, you take the pointer of the first element of the array |
02:07:19 | nisstyre | I think I actually want UncheckedArray since I don't know the size at compile time |
02:07:29 | nisstyre | Varriount: ok sounds good |
02:13:17 | * | vicfred joined #nim |
02:28:46 | FromDiscord | <Varriount> @nisstyre: You can also do the same thing with sequences (although, you obviously have to be more careful there, due to the dynamic length). |
02:30:49 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:31:33 | disruptek | people usually tell me to be careful with my dynamic girth. |
02:32:38 | * | muffindrake joined #nim |
02:35:32 | FromDiscord | <Varriount> disruptek: You just can't help yourself, can you. π |
02:48:14 | * | thomasross quit (Ping timeout: 260 seconds) |
02:52:53 | disruptek | what's the fun in that? |
03:03:56 | FromDiscord | <flywind> Hi, disruptek. I have implemented hashed and hierarchical timing wheels and `delayQueue`, but still needs more tests. |
03:03:58 | FromDiscord | <flywind> https://github.com/xflywind/ioselectors/blob/master/src/ioselectors/timerwheel.nim#L26 |
03:04:09 | FromDiscord | <flywind> https://github.com/xflywind/ioselectors/blob/master/tests/timer/t_timerwheel.nim |
03:07:10 | FromDiscord | <flywind> Insert 100,000 random timers is about 8 ms(with `--gc:arc -d:danger`. |
03:08:53 | * | vicfred quit (Quit: Leaving) |
03:13:36 | * | audiofile quit (Quit: Default Quit Message) |
03:22:45 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:27:12 | * | rockcavera quit (Remote host closed the connection) |
03:47:26 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:42 | * | supakeen joined #nim |
04:35:34 | FromDiscord | <iWonderAboutTuatara> Nim is super nice |
04:35:41 | FromDiscord | <iWonderAboutTuatara> I have to say |
04:35:48 | FromDiscord | <iWonderAboutTuatara> It's rust but it's way less painful |
04:35:57 | FromDiscord | <iWonderAboutTuatara> Python-like syntax is the best syntax |
05:05:12 | * | JustASlacker joined #nim |
05:13:34 | * | JustASlacker quit (Ping timeout: 246 seconds) |
05:50:27 | FromDiscord | <flywind> Does `nimrtl` or `nimhcr` have some restrictions in libraries? I want to use logging/strformat/unittest, but they all crashed. |
05:51:50 | Zevv | hcr is tricky |
05:52:15 | Zevv | i'm not sure if it is 100% sane at this time |
05:56:47 | * | solitudesf joined #nim |
05:57:20 | * | cornfeedhobo quit (Remote host closed the connection) |
06:00:29 | * | hnOsmium0001 joined #nim |
06:15:00 | FromDiscord | <iWonderAboutTuatara> Hey, is @ing users through irc broken? |
06:15:04 | FromDiscord | <iWonderAboutTuatara> I remember it being possible |
06:15:09 | FromDiscord | <iWonderAboutTuatara> But I may be going insane |
06:15:28 | FromDiscord | <Rika> try it |
06:26:21 | * | letto quit (Quit: Konversation terminated!) |
06:31:12 | * | letto joined #nim |
06:36:45 | * | JustASlacker joined #nim |
06:38:51 | * | cornfeedhobo joined #nim |
07:35:27 | FromDiscord | <iWonderAboutTuatara> @Zevv[IRC]#0000 |
07:35:34 | FromDiscord | <iWonderAboutTuatara> Just gives the @ |
07:40:31 | * | l1x quit (Ping timeout: 244 seconds) |
07:40:48 | * | Vladar joined #nim |
07:41:03 | * | krux02 joined #nim |
07:41:35 | * | zielmicha__ quit (Read error: Connection reset by peer) |
07:42:37 | * | alehander92 quit (Ping timeout: 260 seconds) |
07:42:46 | * | serthujop joined #nim |
07:45:33 | FromDiscord | <Rika> what |
07:45:56 | FromDiscord | <Rika> i dont understand what you're doing, pinging discord -> irc or irc -> discord |
07:46:11 | FromDiscord | <Rika> one is simply typing the name, the other is `@username` |
07:47:30 | Zevv | zup |
07:48:14 | Zevv | dont know, i just see my nick hopping by and that makes my irc go yellow |
07:48:19 | Zevv | so that wrks |
07:48:27 | * | rayman22201 quit (Ping timeout: 260 seconds) |
07:52:24 | * | endragor quit (Remote host closed the connection) |
07:52:52 | * | endragor joined #nim |
07:54:30 | * | l1x joined #nim |
07:54:34 | * | rayman22201 joined #nim |
07:54:46 | * | zielmicha__ joined #nim |
07:58:05 | * | endragor quit (Ping timeout: 240 seconds) |
07:58:28 | * | alehander92 joined #nim |
08:02:05 | FromDiscord | <djazz> I fixed my code to work with gc:arc, yay! GC_rf/GC_unref while working with the C library helped a lot to clean up my code too! |
08:02:09 | FromDiscord | <djazz> GC_ref* |
08:03:28 | * | endragor joined #nim |
08:03:39 | FromDiscord | <djazz> Still a WIP, I'm wrapping the latest version of webview (there are other nim wrappers, like webview and webgpu, but they use an old version of the C library) https://github.com/daniel-j/nim-webview |
08:04:00 | FromDiscord | <djazz> `nimble task example && ./example` |
08:04:59 | FromDiscord | <djazz> With ARC I also had to remove async stuff, which is fine since I use threadpool instead (gui needs to run on main thread) |
08:05:19 | FromDiscord | <djazz> So callbacks from the gui gets spawn'd |
08:07:14 | FromDiscord | <Elegant Beef> Nice |
08:09:33 | FromDiscord | <djazz> You can see usage of ref/unref here https://github.com/daniel-j/nim-webview/blob/master/src/webview.nim#L158-L168 |
08:10:48 | FromDiscord | <djazz> Once you figure out the quirks, coding with Nim is a joy π |
08:11:03 | FromDiscord | <djazz> I'm happy I'm not doing this in C++/C |
08:11:53 | FromDiscord | <Elegant Beef> what quirks? |
08:13:04 | * | NimBot joined #nim |
08:13:33 | FromDiscord | <djazz> Mostly related to gc. I come from dynamically typed languages (JS, Python, PHP) |
08:14:29 | FromDiscord | <Elegant Beef> Ah |
08:14:39 | FromDiscord | <Elegant Beef> I came from C# so it was only weird to not have classes |
08:15:32 | FromDiscord | <Elegant Beef> But wasnt really weird since the UFCS is a joy |
08:16:18 | FromDiscord | <Elegant Beef> your webview test folder is just a config.nims π |
08:16:51 | FromDiscord | <djazz> I'll add tests later, when I've made the API π |
08:17:06 | FromDiscord | <djazz> WIP, example.nim is my playground |
08:17:27 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
08:18:14 | FromDiscord | <djazz> The compile pragma is great btw. I used nimterop to generate it first, and it used header, and I kept getting symbol duplication. |
08:19:10 | FromDiscord | <djazz> But now I made it compile the C library as an object file and link it. Lots of things in the header that I don't need directly included |
08:20:14 | FromDiscord | <djazz> I only wish the compile pragma had an option to not cache or detect if its dependencies changed |
08:20:46 | FromDiscord | <djazz> webview.cc is a oneliner with `#include "webview.h"`, so changing the header requires the nim -f flag |
08:22:02 | FromDiscord | <Elegant Beef> *This is why you just write everything in pure nim* π |
08:22:17 | FromDiscord | <djazz> I might split up it later so the C api is in one file and the nim module api in one |
08:23:07 | FromDiscord | <djazz> Sure, you do the GTK, Cocoa and EdgeHTML bindings in Nim for me π |
08:25:16 | FromDiscord | <Elegant Beef> On second thought... webviews suck |
08:28:39 | FromDiscord | <djazz> Yeah... but pretty neat way to do cross platform apps (that doesn't use electron) |
08:29:30 | FromDiscord | <djazz> Maybe I can add Qt's WebEngine as alternative to GTK too |
08:30:07 | * | l1x quit (Changing host) |
08:30:07 | * | l1x joined #nim |
08:30:10 | * | rayman22201 quit (Changing host) |
08:30:10 | * | rayman22201 joined #nim |
08:30:10 | * | zielmicha__ quit (Changing host) |
08:30:10 | * | zielmicha__ joined #nim |
08:30:10 | * | alehander92 quit (Changing host) |
08:30:10 | * | alehander92 joined #nim |
08:30:10 | FromDiscord | <djazz> (that would be a big dependency on Windows and macOS, but small on Linux systems running a Qt desktop like KDE) |
08:31:31 | FromDiscord | <djazz> I wonder what name I'll submit this under to nimble, since webview is taken... |
08:32:22 | * | casaca quit (Ping timeout: 246 seconds) |
08:40:11 | * | maier joined #nim |
08:43:12 | FromDiscord | <Elegant Beef> But.. but.. fidget! π |
08:44:10 | * | serthujop quit (Quit: Lost terminal) |
08:47:12 | FromDiscord | <djazz> fidget uses opengl right? |
08:47:20 | * | cornfeedhobo quit (Quit: ZNC - https://znc.in) |
08:47:50 | Araq | iirc yes |
08:49:13 | Zevv | i think fidget is kind of agnostig, opengl is one of the backends |
08:52:02 | FromDiscord | <Elegant Beef> It runs on all platforms in theory |
08:54:21 | FromDiscord | <Elegant Beef> At the moment it only uses opengl/webgl apparently |
08:55:19 | FromDiscord | <Elegant Beef> Rather canvas |
08:58:52 | FromDiscord | <djazz> opengl and cairo for vector and font it seems |
08:59:40 | * | awe00 joined #nim |
09:00:59 | FromDiscord | <djazz> thing is, I need to render html, in a part of the app, with clickable links |
09:03:21 | FromDiscord | <lqdev> fidget doesn't use cairo for font rendering, it uses typography |
09:03:27 | FromDiscord | <Varriount> @djazz Dynamic Typers Unite! |
09:03:35 | * | cornfeedhobo joined #nim |
09:03:35 | FromDiscord | <lqdev> !repo treeform/typography |
09:03:36 | disbot | https://github.com/treeform/typography -- 9typography: 11Fonts, Typesetting and Rasterization. 15 116β 7π΄ |
09:03:37 | FromDiscord | <djazz> π |
09:03:43 | FromDiscord | <Varriount> (I came from Python) |
09:04:17 | FromDiscord | <djazz> something like http://www.litehtml.com/ would be nice to have in fidget |
09:04:49 | FromDiscord | <lqdev> but it's against the point of fidget |
09:05:31 | FromDiscord | <djazz> does fidget have the api so I can draw my own things? |
09:06:06 | FromDiscord | <djazz> or the the backend abstracted away |
09:06:35 | FromDiscord | <Varriount> Or more accurately, what does one do if they need functionality fidget can't provide? |
09:07:05 | FromDiscord | <Varriount> (edit) 'more accurately,' => 'in other words,' |
09:08:43 | FromDiscord | <Rika> i hated dynamic typing |
09:09:13 | FromDiscord | <Rika> when i discovered 3.6 had type annotations i was looking for a way to enforce them without massive performance loss *cough mypy cough* |
09:10:15 | supakeen | They're only for documentation/static analysis it's been quite widely debated if runtime optimizations were to be implemented based on them. |
09:10:26 | supakeen | There are some projects that use them to compile to other languages (like C). |
09:10:34 | FromDiscord | <Rika> i know theyre only for doc |
09:10:40 | FromDiscord | <Elegant Beef> @djazz fidget is literally make your own GUI components |
09:11:06 | supakeen | We do use them at work since they *do* catch certain classes of bugs which is very nice and the documentation is pretty great. |
09:11:23 | supakeen | But CPython is likely to never do anything useful with them at runtime. |
09:11:53 | FromDiscord | <Varriount> As an implementation, CPython is fairly conservative |
09:12:23 | supakeen | Yea, it has only one optimizer (if I recall correctly) and it's a peephole one. |
09:12:31 | FromDiscord | <Varriount> Yes. |
09:12:31 | supakeen | On purpose. |
09:13:16 | FromDiscord | <Varriount> And it was only the most recent version that transitioned to using a more flexible parser generator |
09:13:33 | supakeen | Ah yea, which is why it'll get pattern matching soon (tm). |
09:13:55 | FromDiscord | <Varriount> I'm not fully for that, honestly |
09:14:00 | supakeen | For Guido's EuroPython Q&A I had submitted a question about if they'll use the new PEG parser to get rid of some of the 'warts'. |
09:14:03 | supakeen | But they won't. |
09:14:19 | supakeen | For example `1.foo` vs `(1).foo`. |
09:14:23 | FromDiscord | <Varriount> I feel like, as a language, Python is fairly feature complete |
09:14:30 | supakeen | Since I believe the old parser couldn't go back on error and the new one can. |
09:14:41 | FromDiscord | <djazz> Circuit Python is pretty cool. Running a Python REPL over serial to a microcontroller hehe π |
09:14:46 | supakeen | I am definitely not all for all the bits of patma but some of it is nice. |
09:15:13 | FromDiscord | <Varriount> supakeen: I guess this is something like pattern matching: https://github.com/kolypto/py-good |
09:15:47 | supakeen | Mrm that looks more like validation of data? |
09:16:08 | supakeen | Pattern matching as in the functional term where you can do something like Rust has. |
09:16:21 | supakeen | https://github.com/gvanrossum/patma that one. |
09:16:30 | supakeen | It's a 'different thing' I think. |
09:21:13 | FromDiscord | <Varriount> Eh, I see the uses |
09:21:26 | * | alehander92 is now known as alexander92 |
09:21:41 | * | alexander92 is now known as alehander92 |
09:21:52 | FromDiscord | <Varriount> I'm still not sure it's needed enough to merit adding to the language |
09:22:17 | FromDiscord | <Varriount> But maybe I'm just getting old and conservative |
09:24:14 | Zevv | no man we've got enough of those |
09:25:59 | alehander92 | we have a pre-rfc |
09:26:06 | alehander92 | for pattern matching supakeen |
09:26:13 | alehander92 | btw varriount i never got your objection |
09:26:32 | FromDiscord | <Varriount> Objection for...? |
09:26:34 | alehander92 | validation is not really the same, like, i can imagine it having some related points |
09:27:07 | alehander92 | https://github.com/nim-lang/RFCs/issues/245#issuecomment-663443583 |
09:27:08 | disbot | β₯ Early version of RFC: Pattern matching ? ; snippet at 12https://play.nim-lang.org/#ix=2sbl |
09:27:38 | alehander92 | i mean, it's a great observation, just trying to say one needs it many places where one does just assignment or ifs |
09:27:46 | alehander92 | so it might not be obvious by writing code |
09:28:24 | alehander92 | because oftn matching can be a more succinct syntax for a sequnce of if |
09:28:29 | alehander92 | or if + assignments |
09:28:58 | supakeen | alehander92: Yes I like it :) |
09:29:20 | FromDiscord | <Varriount> I don't understand what that has to do with my comment |
09:30:26 | alehander92 | well, you say you haven't felt the need for it |
09:30:26 | FromDiscord | <Varriount> I guess the `binding` functionality is useful |
09:30:55 | * | NimBot joined #nim |
09:31:20 | alehander92 | and it has different possible idioms which are in a way invisible if one haven't really seen them in code before |
09:31:54 | alehander92 | which is why it might not be a good fit for nim(people just not recognizing it), but i still think it would be valuable |
09:33:00 | alehander92 | e.g. one can use it for unification, combine it well with various ADT-s : nim nodes are a good example exactly because all kinds of variant objects should be well suited for it |
09:47:29 | FromDiscord | <Varriount> alehander92: I wasn't stridently arguing against pattern matching, although I do think an initial implementation using a macro or compiler plugin would be better |
09:47:39 | alehander92 | we have those |
09:47:45 | alehander92 | we have several libs |
09:48:09 | alehander92 | actually my idea would be to just combine them together into a more refined api |
09:48:15 | alehander92 | again using a macro-only lib if possible |
09:48:56 | alehander92 | i don't want to change the core language (yeah, it would probably make some of those features better, but nim is about macros right |
09:48:57 | alehander92 | ) |
09:52:09 | FromDiscord | <Varriount> My biggest feature wish is to get macros that can alter (at least) the AST of the scope they are called in, that is after their invocation. |
09:52:54 | FromDiscord | <Varriount> Essentially, block macros, but without having to indent |
09:55:26 | FromDiscord | <Varriount> sent a code paste, see https://play.nim-lang.org/#ix=2uHR |
10:07:07 | * | abm joined #nim |
10:11:30 | * | nc-x joined #nim |
10:13:25 | * | vikfret quit (Ping timeout: 264 seconds) |
10:14:53 | * | nc-x quit (Remote host closed the connection) |
10:15:50 | alehander92 | hm |
10:16:10 | alehander92 | but why not indenting |
10:16:17 | alehander92 | i honestly prefer having another keyword |
10:16:34 | alehander92 | i think it's a bit confusing when behavior changes based on a directive up there |
10:16:51 | alehander92 | (on the other hand, that's what async pragma etc do so, i am not very fair in that) |
10:17:36 | alehander92 | othewise, people often want to change the callsite somehow |
10:18:08 | alehander92 | but i kinda agree with araq that this seems like a big change: it makes it harder to know what does a macro change |
10:30:02 | * | bung joined #nim |
10:31:32 | * | casaca joined #nim |
10:40:20 | * | NimBot joined #nim |
10:46:33 | * | arecacea1 quit (Remote host closed the connection) |
10:47:14 | * | arecacea1 joined #nim |
10:52:15 | * | kinkinkijkin joined #nim |
10:54:32 | kinkinkijkin | hello, I'm using the nimgl vulkan bindings with the intent of properly learning vulkan, using the nim reference, nimgl reference, and vulkan tutorial and reference |
10:55:35 | kinkinkijkin | but I've been stopped at the fact that I forgot what nim code corresponds to a class with public and private members from C++ lol |
10:55:58 | kinkinkijkin | done way too much functional programming of late |
10:58:47 | kinkinkijkin | note entirely sure why they're using a class for it, since I don't know the api well |
10:58:54 | kinkinkijkin | not* |
11:01:35 | kinkinkijkin | nevermind, actually read through the tutorial further to find why, it's not necessary |
11:02:27 | * | vikfret joined #nim |
11:03:34 | * | waleee-cl joined #nim |
11:35:26 | * | Zectbumo quit (Remote host closed the connection) |
11:59:41 | * | lritter joined #nim |
12:02:31 | * | bung quit (Quit: Lost terminal) |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:33 | * | supakeen joined #nim |
12:11:53 | * | maier quit (Quit: leaving) |
12:19:12 | * | PMunch joined #nim |
12:19:48 | * | rockcavera joined #nim |
12:33:54 | * | Kaivo quit (Ping timeout: 265 seconds) |
12:35:59 | * | Kaivo joined #nim |
12:37:32 | * | vicfred joined #nim |
12:38:35 | federico3 | https://analysis-tools.dev/tag/c anything useful for Nim? |
12:41:01 | * | dv^_^ quit (Ping timeout: 264 seconds) |
12:51:45 | FromDiscord | <djazz> Noticed switch("gc", "arc") in config.nims causes a ton of errors, but works fine with --gc:arc hah |
12:52:34 | FromDiscord | <Recruit_main707> thats very weird... how are your files named? |
12:53:00 | FromDiscord | <Recruit_main707> federico3 cant you just use a c/c++ one? |
12:53:12 | FromDiscord | <Recruit_main707> its basically what you are gonna find |
12:53:26 | FromDiscord | <djazz> ..assuming that's how you set switches when running nimble run/build |
12:53:58 | FromDiscord | <Rika> what errors are given |
12:54:36 | Araq | federico3, DrNim is influenced by Frama C |
12:54:55 | FromDiscord | <vieru> sent a long message, see http://ix.io/2uIu |
12:55:23 | federico3 | Recruit_main707 huh? |
12:55:57 | FromDiscord | <Recruit_main707> djazz: do you have your main.nim file, and a main.nims file in the same dir? |
12:56:16 | * | Lord_Nightmare quit (Ping timeout: 246 seconds) |
12:56:26 | FromDiscord | <djazz> no, just config.nims at root of my project |
12:56:28 | FromDiscord | <Recruit_main707> federico3: nvm... i didnt understand :p |
12:56:40 | FromDiscord | <djazz> lots of errors like `stdlib_io.nim.cpp:270:6: note: crosses initialization of βint T7_β` |
12:57:03 | FromDiscord | <djazz> `stdlib_tables.nim.cpp:1041:3: error: jump to label βLA1_β` |
12:57:08 | FromDiscord | <Recruit_main707> hmm, im not sure how its done with nimble, what happens if you do it that way? |
12:58:06 | FromDiscord | <djazz> I haven't used nims files before now |
13:05:58 | FromDiscord | <kodkuce> hmm 1 issue with dumping all in one file now i am wasting time scroling to find what i want |
13:06:14 | FromDiscord | <kodkuce> and i have only 512 line of code |
13:06:48 | FromDiscord | <kodkuce> tough i would be anble to use search to jump but i frogot how i named half stuff xD |
13:07:46 | FromDiscord | <kodkuce> and i just now figured out i can ctrl clink on error link to jump to it π |
13:08:45 | * | tane joined #nim |
13:18:22 | * | vicfred quit (Remote host closed the connection) |
13:18:46 | * | vicfred joined #nim |
13:19:10 | * | vikfret_ joined #nim |
13:21:23 | * | vikfret quit (Ping timeout: 240 seconds) |
13:23:00 | leorize | @djazz that's ood, `--` is a macro that translates to `switch()` |
13:23:05 | leorize | have you filed an issue? |
13:26:47 | * | vikfret_ quit (Quit: Leaving) |
13:34:58 | * | Vladar quit (Remote host closed the connection) |
13:36:24 | FromGitter | <jorjun_twitter> proc mytest*(): cint {.importc, dynlib:"test.so" .} |
13:36:51 | FromGitter | <jorjun_twitter> Compiles OK, but getting: test.so: cannot open shared object file: No such file or directory |
13:37:19 | shashlick | LD_LIBRARY_PATH=. |
13:37:55 | FromGitter | <jorjun_twitter> tried that.. itβs in there.. |
13:38:56 | FromGitter | <jorjun_twitter> I mean I have a bin folder next door to my nim file and the test.so is in there and full path to that bin folder is in LD_LIBRARY_PATH. Still no joy |
13:40:00 | * | Vladar joined #nim |
13:40:33 | FromGitter | <jorjun_twitter> ah it says, β...bin/test.so: only ET_DYN and ET_EXEC can be loaded" |
13:44:25 | * | Lord_Nightmare joined #nim |
13:45:55 | FromGitter | <jorjun_twitter> looks like I wonβt be able to leverage c libraries without getting further into being a low level c nerd.. |
13:46:23 | FromGitter | <jorjun_twitter> will do more of that.. |
13:46:24 | shashlick | what exactly is your issue |
13:48:51 | FromDiscord | <kodkuce> can i have try catch in try catche? |
13:48:55 | FromDiscord | <kodkuce> nested |
13:49:54 | FromDiscord | <kodkuce> will just nim playground it |
13:51:29 | PMunch | Of course, why wouldn't that work? |
13:52:56 | FromGitter | <jorjun_twitter> @shashlick Looking to understand the nim runtime error: β...bin/test.so: only ET_DYN and ET_EXEC can be loadedβ trying to wrap a shared library that depends on lots of other shared librariesβ¦ now thinking I need to make a libxxx.a of them all and try to link to just that |
13:54:12 | FromGitter | <UrKr> Hi, β Why does this throw this error: β β ```code paste, see link``` β ... [https://gitter.im/nim-lang/Nim?at=5f3e8083efafab7e3a8831f6] |
13:54:42 | FromGitter | <UrKr> It used to work so something must have changed |
13:55:21 | FromDiscord | <Rika> `expr` is now `typed` i think |
13:57:09 | FromGitter | <UrKr> Thanks, that worked if I remove the pragma. I get a warning though β Warning: inherit from a more precise exception type like ValueError, IOError or OSError. If these don't suit, inherit from CatchableError or Defect. [InheritFromException] |
13:57:20 | FromDiscord | <haxscramper> If I create PR in the nimble package repository it still has to be manually reviewed for someone, right? If it passed CI tests |
13:58:59 | FromDiscord | <djazz> Wow, adding a proc from GTK was easy! Huh. `proc gtk_window_set_decorated(window: WebviewWindow, setting: bool) {.header: "<gtk/gtk.h>".}` |
13:59:22 | FromDiscord | <djazz> then just calling it like a nim proc. No emit pragma hacking |
13:59:53 | FromDiscord | <Rika> @UrKr that sounds like an issue from a different portion of your code now, an object that is `of Exception`, it says what to do in the error |
14:00:00 | shashlick | @djazz what issue did you have with nimterop earlier |
14:01:06 | FromDiscord | <djazz> duplicate imported symbols, might be the lib. So I use compile pragma now, instead of header/dynlib |
14:01:37 | FromDiscord | <djazz> not symbols, sorry. name collisions |
14:01:44 | FromDiscord | <djazz> in the generated C++ code |
14:03:08 | FromDiscord | <kodkuce> https://play.nim-lang.org/#ix=2uIU i want to close connection, whitout doom |
14:07:59 | shashlick | @djazz any output you can share? |
14:08:04 | shashlick | Or snippet |
14:08:23 | shashlick | Did you gave multiple cimport calls |
14:09:02 | FromDiscord | <djazz> I'll refactor it so I can put the C-nim procs in its own file, then I'll try |
14:09:17 | FromDiscord | <djazz> I think I used toast on cli |
14:10:27 | FromDiscord | <adokitkat> sent a code paste, see https://play.nim-lang.org/#ix=2uIW |
14:10:55 | FromDiscord | <adokitkat> (edit) 'https://play.nim-lang.org/#ix=2uIW' => 'https://play.nim-lang.org/#ix=2uIX' |
14:11:41 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
14:11:59 | Araq | djazz, try .importc: "...", header: "..." or .importc, nodecl |
14:13:04 | FromGitter | <UrKr> Is this no longer how you define a new xml tag or am I calling it wrong β β ```code paste, see link``` β β I got the pattern from here ... [https://gitter.im/nim-lang/Nim?at=5f3e84efee58011680bb48f1] |
14:13:30 | FromGitter | <UrKr> I get this β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5f3e850a3dac5343401ca286] |
14:14:05 | Araq | remove the line 'let e = callsite()' |
14:14:40 | FromGitter | <UrKr> Thanks, that did the trick |
14:14:56 | FromDiscord | <djazz> ah, I was messing with nodecl when trying to get my callbacks to work, that might be it. |
14:14:59 | Araq | and please update your Nim compiler so that you can look at a modern htmlgen.nim file |
14:15:37 | FromGitter | <UrKr> Ok! |
14:16:33 | FromDiscord | <djazz> right now they are just importc heh `proc webview_create(debug: cint = 0; window: pointer): webview_t {.importc.}` |
14:18:25 | FromDiscord | <djazz> I'm learning! This is fun! |
14:19:16 | * | Vladar quit (Ping timeout: 265 seconds) |
14:19:34 | FromGitter | <jorjun_twitter> cracked it⦠extra gcc in makefile to make a single giant shared library, then worked fine. |
14:19:48 | FromDiscord | <Recruit_main707> cool |
14:20:35 | * | Vladar joined #nim |
14:33:08 | FromDiscord | <djazz> oh, I got it working with header and cdecl/nodecl https://github.com/daniel-j/nim-webview/blob/master/src/webview.nim#L7-L8 |
14:33:39 | FromDiscord | <djazz> it works with both cdecl and nodecl. What do they do exactly? |
14:34:39 | disruptek | no one knows. |
14:36:07 | FromDiscord | <djazz> I'll put nodecl there, just in case |
14:38:03 | Araq | djazz: use .header rather than .nodecl |
14:39:18 | FromDiscord | <djazz> https://media.discordapp.net/attachments/371759389889003532/746015504782589952/DBcUtoo.png |
14:41:46 | Araq | .header implies .nodecl |
14:43:08 | FromDiscord | <djazz> ah |
14:43:10 | FromDiscord | <djazz> makes sense |
14:43:23 | FromDiscord | <djazz> screenshot of the example app https://media.discordapp.net/attachments/371759389889003532/746016534010265640/Screenshot_from_2020-08-20_16-42-58.png |
14:44:46 | FromDiscord | <djazz> best way to invoke the js compiler is outside of the main cpp nim compile? or can js be compiled as part of the cpp compile? |
14:47:25 | disruptek | what are you talking about? |
14:53:06 | disruptek | my word-salad parser is offline, i guess. |
14:55:08 | FromDiscord | <mratsim> @djazz look at https://github.com/Vindaar/NeuralNetworkLiveDemo |
15:00:21 | FromDiscord | <djazz> There is no build script. And the html loads the js file from a local nimcache folder |
15:00:39 | shashlick | @djazz - https://github.com/nimterop/nimterop#header-vs-dynlib also describes some details around this |
15:02:17 | * | audiofile joined #nim |
15:09:18 | * | hnOsmium0001 joined #nim |
15:12:14 | * | dv^_^ joined #nim |
15:16:09 | FromDiscord | <djazz> Thanks |
15:19:27 | * | audiophile joined #nim |
15:20:30 | * | audiofile quit (Ping timeout: 260 seconds) |
15:20:35 | * | audiophile is now known as audiofile |
15:36:56 | disruptek | leorize: the problem with nim.nvim is that when nimsuggest doesn't work, which is frequently, i really feel the pain. π€£ |
15:37:59 | disruptek | we need a wiki entry that reminds me how to do logging. |
15:42:00 | shashlick | no takers for nimble localdeps testing? |
15:42:32 | disruptek | maybe status are the only customers? |
15:44:33 | shashlick | many have grumbled about shared deps |
15:53:30 | krux02 | disruptek, I think that is a good point. Logging is something that comes up again and again. But pay respect that there is no universal logging solution. For my personal projects printing with echo does work fine already. |
15:54:12 | krux02 | some logging you want to switch on/off at compile time, some you want to control at runtime. And some you want to remove again from source if debugging is done. |
15:55:27 | FromDiscord | <Kiloneie> There is no good debugger for Nim is there? (i mean i know the tracebacks are really good) Does anyone use a debugger? |
15:55:47 | FromDiscord | <lqdev> i sometimes use gdb when dealing with C interop |
15:55:57 | FromDiscord | <lqdev> but otherwise echo-debugging is good enough |
15:57:10 | FromDiscord | <Kiloneie> I read something similar for profiling. |
15:58:08 | FromDiscord | <Kiloneie> Nim doesn't seem to need a debugger to be honest, at least when using pure Nim. |
15:58:48 | leorize | disruptek: yea, I'm planning to implement some easy debugging option for nim.nvim |
15:59:00 | leorize | will do after this month, I'm wrapping up some stuff atm |
15:59:13 | * | endragor quit (Remote host closed the connection) |
15:59:19 | leorize | @Kiloneie: nim-gdb works well enough |
15:59:34 | FromDiscord | <Kiloneie> Okay |
15:59:41 | * | endragor joined #nim |
15:59:52 | FromDiscord | <lqdev> leorize: error reporting when |
15:59:58 | leorize | it doesn't understand seqs though, so you have to do the arcane magic of `print seq->data[0]` |
16:00:03 | shashlick | The profile module works pretty well |
16:00:10 | shashlick | And gdb is great for pure Nim as well |
16:00:24 | leorize | @lqdev soonβ’ |
16:00:31 | FromDiscord | <lqdev> 'kay |
16:00:36 | leorize | I'll have to add something to make nimsuggest prints to stdout/stderr |
16:00:43 | disruptek | krux02: yeah, i wrote up my thoughts on logging in the rfc on the subject; i was talking about nvim logging... |
16:00:47 | leorize | log file is fine and all but integration with that is a pain |
16:00:47 | FromGitter | <awr1> i use gdb occasionally but echo is good enough. obviously this is you know, "not good enough" for a lot of prospective people looking to play with nim |
16:01:01 | FromGitter | <awr1> `system.locals` is also neat for debugging if somewhat obscure |
16:01:28 | FromGitter | <awr1> for graphics debugging i use renderdoc but this is not really relevant to most people. |
16:01:50 | * | dddddd_ joined #nim |
16:01:54 | krux02 | awr1: well I use renderdoc as well |
16:02:10 | krux02 | so it is relevant. |
16:03:44 | * | dddddd quit (Ping timeout: 256 seconds) |
16:03:47 | FromGitter | <awr1> yeah renderdoc is quite good, i use it quite frequently, great for Vulkan, GL, D3D dev. i have only sort of ever played with NSight and i've never used PIX or the microsoft gpu debugging utils so i can't really compare it to them. renderdoc got some interesting SPIR-V shader debugging options quite recently that i've been itching to play with |
16:03:48 | krux02 | Sorry, I use apitrace not renderdoc. Every time I used renderdoc it segfaulted instantly, I could never use it. |
16:04:22 | krux02 | was a few years ago, could have been fixed by now. |
16:04:29 | FromGitter | <awr1> i have never seen apitrace before |
16:04:40 | * | FromDiscord quit (Remote host closed the connection) |
16:04:44 | krux02 | it was my only option. |
16:04:45 | * | endragor quit (Ping timeout: 240 seconds) |
16:04:54 | * | FromDiscord joined #nim |
16:04:57 | krux02 | It is not a real debugger |
16:05:01 | * | awe001 joined #nim |
16:05:11 | krux02 | it is a recording device |
16:05:33 | krux02 | you record OpenGL commands and then you replay them and it shows you buffer content and stuff like that. |
16:06:06 | krux02 | since it records all OpenGL calls it really shows you how something is drawn in a game. |
16:06:13 | * | awe00 quit (Ping timeout: 264 seconds) |
16:06:18 | krux02 | I'ven run it on several games by now. |
16:06:41 | FromGitter | <awr1> yeah it's not a "debugger" in the traditional sense like gdb, although maybe that has technically changed with the recent SPIR-V addons |
16:07:10 | FromGitter | <awr1> but it's still a "debugger" insofar that it is useful for diagnosing rendering issues and profiling |
16:08:32 | FromGitter | <awr1> is @mratsim here? |
16:13:50 | FromDiscord | <Varriount> Depends on who's askin' |
16:14:03 | FromDiscord | <Varriount> You wit da cops? |
16:15:31 | PMunch | Haha :P |
16:16:16 | FromGitter | <awr1> lol |
16:16:59 | PMunch | He's not on IRC at least |
16:17:06 | * | PMunch shuffles mratsim out the back door |
16:17:28 | PMunch | That's extra fun as you can't see those messages :P |
16:17:39 | * | PMunch says that this is our secret IRC language! |
16:17:54 | FromDiscord | <Hearthstone> What?- |
16:17:59 | FromDiscord | <lqdev> he's away on discord |
16:18:04 | FromDiscord | <Hearthstone> https://media.discordapp.net/attachments/371759389889003532/746040364221333574/Screenshot_20200820_171755_com.cutthecord.base.jpg |
16:18:16 | FromGitter | <awr1> it's The French Connection, but with nim instead of contraband |
16:18:34 | disruptek | man, i really need plumbing. |
16:18:39 | FromDiscord | <lqdev> PMunch: was that a /me? |
16:18:56 | PMunch | Uhm, no... |
16:19:10 | * | PMunch yes it totally was |
16:19:25 | FromDiscord | <lqdev> you can't lie to me. i have the power of the log! https://media.discordapp.net/attachments/371759389889003532/746040704404553839/unknown.png |
16:19:44 | PMunch | Oh damn it, I've been made! |
16:20:02 | * | PMunch runs after mratsim to go hide |
16:20:20 | PMunch | But wait, the bot actually relays those over to Discord now? |
16:21:08 | FromDiscord | <lqdev> no |
16:21:14 | FromDiscord | <lqdev> i just guessed |
16:21:25 | FromDiscord | <lqdev> discord doesn't have /me |
16:21:33 | FromDiscord | <lqdev> _it literally looks like this lol_ |
16:21:49 | FromDiscord | <lqdev> just wraps your text in __ |
16:21:50 | FromGitter | <awr1> IRC is insecure |
16:21:54 | PMunch | But Hearthstone shared a screenshot where they did show up? |
16:21:58 | FromGitter | <awr1> switch to superior military grade ROT13 encryption immediately |
16:22:01 | disruptek | awr1 is insecure. |
16:22:13 | FromDiscord | <lqdev> PMunch: they're relayed by ircord |
16:22:15 | FromGitter | <awr1> true |
16:22:41 | PMunch | Yeah that's what I meant, so you can see what I type there (although it misses my nick, which kinda is the whole point..) |
16:23:32 | * | def-- joined #nim |
16:23:39 | FromGitter | <awr1> ROT13 is technically "military-grade" when you think about it because it is a Caesar Cipher |
16:23:59 | * | def- quit (Ping timeout: 256 seconds) |
16:23:59 | * | def-- is now known as def- |
16:24:32 | * | awe001 quit (Ping timeout: 256 seconds) |
16:24:49 | disruptek | shashlick: has anyone at all tested it other than yourself? |
16:25:43 | * | leorize quit (Ping timeout: 240 seconds) |
16:26:21 | * | leorize joined #nim |
16:35:18 | * | awe001 joined #nim |
16:37:46 | shashlick | Local deps? Just me - is still a pr |
16:38:08 | disruptek | what should i do to test it? |
16:38:15 | shashlick | Have some minor changes still to push and test cases to make |
16:40:28 | disruptek | okay, lemme know. i will test it... somehow. |
16:41:18 | * | awe002 joined #nim |
16:43:48 | * | awe001 quit (Ping timeout: 256 seconds) |
16:51:25 | * | awe002 quit (Ping timeout: 240 seconds) |
16:52:29 | shashlick | disruptek - okay, `nimble install https://github.com/genotrance/nimble@#localdeps` and then clone any project |
16:52:34 | shashlick | mkdir nimbledeps |
16:52:51 | shashlick | after that all nimble operations should use that nimble dir |
16:52:55 | shashlick | global shouldn't be used |
16:52:56 | * | endragor joined #nim |
16:53:32 | shashlick | maybe nimble install --nimbleDir:xyz - that way you don't install nimble globally |
16:53:59 | disruptek | i'm using my git branch. |
16:54:55 | disruptek | wow, it builds so fast. |
16:55:11 | shashlick | no more compiler right |
16:55:35 | * | awe002 joined #nim |
16:55:39 | disruptek | you took the compiler out? |
16:56:01 | shashlick | long ago |
16:56:04 | * | rockcavera quit (Remote host closed the connection) |
16:56:05 | shashlick | nimble just calls `nim e` |
16:56:10 | disruptek | huh. |
16:56:37 | disruptek | i'm actually embedding the compiler into nimph to do nimscript. |
16:57:11 | disruptek | everything is so much easier and faster without nimble requirements. |
16:58:11 | shashlick | that's what nimble used to do |
16:58:18 | shashlick | i got rid of that and simply call nim e |
16:58:24 | disruptek | yeah. |
16:58:28 | shashlick | this was April last year |
16:58:49 | disruptek | i got confused between you pulling the compiler out of nimble and pushing it into nimterop. π |
16:58:57 | shashlick | ah k |
16:59:41 | disruptek | it's weird, it used to be that nimph was around 600k lines. now it's like 500-550k. so somehow our deps are getting tighter. |
16:59:42 | shashlick | ideally you could play with pnodes both in macros and runtime |
17:00:16 | disruptek | i'm trying to build paranim but it's gonna take ages because i have so little bandwidth. |
17:00:17 | shashlick | without having to import the compiler |
17:00:24 | disruptek | ah, it crashed. |
17:00:31 | shashlick | the compiler should be stdlib |
17:00:46 | disruptek | ideally, we don't have macros. |
17:01:06 | disruptek | well, it seems that it did not use my localdeps directory. |
17:01:23 | shashlick | its called nimbledeps |
17:01:27 | disruptek | oh shit. |
17:01:44 | shashlick | come on, confusion is useful |
17:02:00 | disruptek | i guess you know what the idiots are going to try. |
17:02:36 | shashlick | its hard enough keeping up with normal folks, idiots are also known as manual fuzzers |
17:03:18 | disruptek | what use could it be to be in localdeps mode and /NOT/ download packages.json from teh interwebs? |
17:04:16 | shashlick | i don't see why that question is useful in any scenario |
17:04:21 | disruptek | Tip: 365 messages have been suppressed, use --verbose to show them. |
17:05:52 | shashlick | what say - does it work |
17:06:01 | * | endragor quit (Ping timeout: 265 seconds) |
17:06:33 | shashlick | you can try your chmod 000 ~/.nimble trick |
17:06:39 | disruptek | turns out i'm dumb. paranim is just a lib. |
17:06:51 | disruptek | i'm trying paravim now. |
17:07:08 | disruptek | so far, so good. it takes awhile because my network is almost as slow as my brain. |
17:07:44 | * | natrys joined #nim |
17:08:19 | disruptek | seems like it worked. |
17:09:56 | disruptek | hmm, it didn't build libvim. |
17:11:32 | disruptek | i gave it a url and it tried to install it. seems like this is working great, shashlick. |
17:12:17 | * | Trustable joined #nim |
17:12:51 | shashlick | i'm wondering about `nimble develop pkgname` |
17:13:01 | shashlick | should we add a flag to that to set it up in local deps mode |
17:13:34 | disruptek | develop mode is weird because of the chain of .nimble-links. |
17:13:51 | shashlick | if you are in a project with localdeps, it will clone to pkgname directory and link into localdeps so that work swell |
17:14:17 | disruptek | right. |
17:14:17 | shashlick | but if you are going to nimble develop the top level project from scratch, it will end up installing deps in ~/.nimble |
17:14:47 | disruptek | even if there's a nimbledeps directory? |
17:15:29 | disruptek | oh, you mean after the initial clone it will continue to install the deps... |
17:16:05 | shashlick | ya - if you are in a project, it works fine |
17:16:11 | shashlick | but if it is the project, it doesn't |
17:16:24 | shashlick | so one option is to add a flag |
17:16:42 | shashlick | or instead detect if the directory is empty and clone into it instead of a subdir |
17:16:47 | disruptek | araq told me he loves environmental variables. |
17:16:53 | disruptek | he prefers them to flags, always. |
17:17:30 | disruptek | i know, i was surprised, too. |
17:30:27 | shashlick | am propagating to child processes with NIMBLE_DIR |
17:31:16 | disruptek | that should make him very happy. |
17:48:57 | * | audiophile joined #nim |
17:49:05 | FromDiscord | <mratsim> @awr1 yes? |
17:49:10 | shashlick | @dom96 - you around |
17:51:35 | * | audiofile quit (Read error: Connection reset by peer) |
17:51:41 | * | audiophile is now known as audiofile |
17:58:22 | FromDiscord | <--HA--> When I declare a variable and then only use it in the scope of a when statement I get a warning about declared but not used. Is there a good way to get rid of that warning? |
18:02:28 | FromDiscord | <mratsim> let foo {.used.} = blah() |
18:18:41 | FromDiscord | <dom96> shashlick: now I am |
18:21:54 | FromGitter | <awr1> hey @mratsim what are your thoughts on this? https://github.com/mratsim/weave/issues/163 |
18:21:55 | disbot | β₯ [Request] Optional per-thread startup procedure |
18:22:19 | FromDiscord | <--HA--> @mratsim thanks |
18:22:43 | * | rockcavera joined #nim |
18:23:16 | FromDiscord | <mratsim> @awr1 yes that's a good idea, and similarly, exit should allow for a cleanup proc |
18:23:37 | FromGitter | <awr1> allright! i think i might do a PR then tomorrow |
18:30:38 | shashlick | @dom96 - so should we add a custom nimbleDir/bin (command line, env var or nimbledeps) to the path for child processes |
18:31:47 | shashlick | i am forwarding nimbledir to child processes - https://github.com/nim-lang/nimble/pull/834/files#diff-8f5588fb3c673d679a2ed04e79cdc74eR253 |
18:31:48 | disbot | β₯ Local deps mode |
18:32:02 | shashlick | so if you call nimble in a task, it will still use the same nimbleDir |
18:32:10 | shashlick | https://github.com/nimble-test/issue280and524/blob/master/issue280and524.nimble is a good test case |
18:32:35 | shashlick | but now that test breaks since `generator` isn't in the path anymore |
18:32:55 | shashlick | so the question is whether to add them to path at least within nimble and its child tasks |
18:47:32 | * | Jesin joined #nim |
18:50:21 | * | waleee-cl joined #nim |
19:01:02 | FromDiscord | <dom96> shashlick: sure, I don't see why not. |
19:01:47 | * | Jesin quit (Quit: Leaving) |
19:06:10 | * | dddddd_ is now known as dddddd |
19:09:09 | shashlick | ok cool |
19:21:51 | FromDiscord | <fracasse> Heyo! |
19:22:10 | FromDiscord | <dom96> hiya! |
19:22:13 | FromDiscord | <lqdev> hi |
19:22:17 | FromDiscord | <fracasse> I have a question: how do I initialize a seq of strings so that the compiler doesn't deem it a `seq[TaintedString]`? |
19:22:41 | FromDiscord | <lqdev> !eval TaintedString is string |
19:22:43 | NimBot | Compile failed: ???(0, 0) Error: expression 'true' is of type 'bool' and has to be discarded |
19:22:53 | FromDiscord | <fracasse> hmmmm |
19:23:17 | FromDiscord | <fracasse> It may be the same, but I have a type that requires a seq[string] |
19:23:29 | FromDiscord | <fracasse> Should I change the field's type to `seq[TaintedString]` then? |
19:23:36 | FromDiscord | <lqdev> hold on |
19:23:45 | FromDiscord | <lqdev> !eval echo seq[string] is seq[TaintedString] |
19:23:48 | NimBot | true |
19:23:54 | FromDiscord | <lqdev> nah should be fine |
19:24:12 | FromDiscord | <lqdev> by default `type TaintedString = string` |
19:24:21 | FromDiscord | <fracasse> cause this is what i get: https://media.discordapp.net/attachments/371759389889003532/746087239217447032/Zrzut_ekranu_2020-08-20_o_21.24.13.png |
19:24:31 | FromDiscord | <fracasse> oh no wait |
19:24:34 | FromDiscord | <fracasse> no non o |
19:24:36 | FromDiscord | <lqdev> you're passing a seq[string] to where a single string is expected |
19:24:39 | FromDiscord | <fracasse> yes yes |
19:25:05 | FromDiscord | <fracasse> xD you're right |
19:25:17 | FromDiscord | <fracasse> so this was just my mistake |
19:25:36 | FromDiscord | <fracasse> On that note, what's the semantic difference between strings and tainted strings? Just so I know. |
19:26:19 | FromDiscord | <lqdev> there's a compiler switch --taintMode:(on|off) which, if enabled, turns `type TaintedString = string` to `type TaintedString = distinct string` |
19:26:21 | Zevv | tainted strings come from the big bad world |
19:26:36 | FromDiscord | <lqdev> yeah zevv is right |
19:26:44 | Zevv | as always |
19:26:56 | FromDiscord | <lqdev> TaintedStrings are user input from outside of your program's source |
19:27:01 | FromDiscord | <Clyybber> you know what also comes from the big bad world |
19:27:08 | FromDiscord | <fracasse> Aah, I see |
19:27:08 | Zevv | my mooom |
19:27:11 | FromDiscord | <Clyybber> the bug that keeps my typed fix from bootstrapping |
19:27:26 | FromDiscord | <Clyybber> or rather the fact that I can't spot the mistake |
19:27:54 | FromDiscord | <fracasse> Thanks everyone! |
19:28:20 | FromDiscord | <fracasse> By the way this is @aachh here. |
19:28:35 | Zevv | clyybber: so what happens exactly then? |
19:29:43 | FromDiscord | <fracasse> When? |
19:32:47 | FromDiscord | <Clyybber> Zevv: Basically instead of backing up the current scope I now open and close a scope |
19:33:27 | FromDiscord | <Clyybber> so that this works: https://github.com/nim-lang/Nim/pull/15158/files#diff-8ebf85b0c488068cf672b3cc15f5d0d0R345-R351 |
19:33:28 | disbot | β₯ Fix #5691 |
19:34:05 | FromDiscord | <Clyybber> but the issue is that I'm getting an undeclared identifier error in guards.nim |
19:34:28 | FromDiscord | <Clyybber> maybe the right time to use disrupteks minimizer |
19:41:37 | Zevv | hmm you asked ar4q i assume |
19:42:12 | FromDiscord | <Clyybber> not yet |
19:42:16 | disruptek | i doubt it'll work but i'd be interested if you try it. |
19:42:33 | FromDiscord | <Clyybber> disruptek: Do you think it can work on the whole compiler? |
19:42:53 | disruptek | it only cares about the input file, so, sure, maybe. |
19:43:05 | FromDiscord | <Clyybber> I mean on multiple input files |
19:43:05 | Zevv | you know dust works by means of mechanical turk right? you run it, it sends a copy to disruptek, he quickly minimizes and sends it back to you |
19:43:14 | disruptek | lol |
19:43:39 | Zevv | you cant imaging how much work I have keeping npeg running these days |
19:43:48 | FromDiscord | <Clyybber> disruptek: Can it work on multiple files? |
19:44:00 | disruptek | i need it to work on multiple inputs, but i haven't figured out how to hook includes properly. i want imports to flow through. |
19:44:09 | disruptek | no, it only works on the main input file. |
19:44:10 | FromDiscord | <Clyybber> hmm ok |
19:44:17 | disruptek | but, it's like `nim check`. |
19:44:29 | disruptek | copy guards.nim to goats.nim and then dust goats.nim |
19:45:38 | disruptek | also i would probably only enable to removeIndex yield in dust/mutate.nim |
19:45:49 | * | awe002 quit (Ping timeout: 264 seconds) |
19:46:00 | disruptek | the others aren't super useful and they will probably make it too slow. |
19:47:03 | FromDiscord | <Clyybber> how long does it take usually? |
19:47:23 | disruptek | it's exhaustive, so it takes a very long time. |
19:47:37 | disruptek | but, it will keep showing you its best effort. |
19:47:49 | disruptek | i mean, a couple minutes for a small file. |
19:47:54 | FromDiscord | <Clyybber> ok |
19:47:59 | * | awe002 joined #nim |
19:48:06 | FromDiscord | <Clyybber> I will to finish my manual appraoach |
19:48:06 | disruptek | i does like 10 compiles/sec. |
19:48:12 | FromDiscord | <Clyybber> and see if it leads me anywhere |
19:48:14 | FromDiscord | <Clyybber> and the ndust |
19:48:27 | disruptek | yeah, anything you can remove ahead of time will help. |
19:49:55 | FromDiscord | <tomck> Hello! Is there support for weak refs? I'm currently using the traditional GC but might switch to ARC at some point |
20:04:12 | * | abm quit (Read error: Connection reset by peer) |
20:04:38 | * | abm joined #nim |
20:09:40 | disruptek | sorta; you can read about cursors. |
20:10:26 | disruptek | ^ tomck |
20:10:59 | FromDiscord | <tomck> hmmm so i might as well just use ptr? |
20:12:52 | FromDiscord | <tomck> https://nim-lang.github.io/Nim/destructors.html#cursor-inference-slash-copy-elisionβ΅Hmmm, does this mean that `tab` is also an inferred cursor? |
20:14:10 | disruptek | no, ptr doesn't get any management under arc. |
20:15:00 | disruptek | tab is a value type, although due to its size it'll be passed by reference. |
20:15:56 | disruptek | what do you think of nim after having used it for a few weeks? |
20:16:56 | Zevv | I'm getting the hang of it |
20:17:01 | disruptek | nice. |
20:21:05 | Zevv | I do not understand the first sentence in https://nim-lang.github.io/Nim/destructors.html#swap: "The need to check for self-assignments and also the need to ..." |
20:21:08 | Zevv | can someone elaborate on this? |
20:21:57 | disruptek | imagine that you put x into y; that involves destroying y. |
20:22:05 | disruptek | to make room for x, right? |
20:22:08 | Zevv | right |
20:22:35 | disruptek | but we don't want to run destructors for a swap. |
20:22:53 | disruptek | so we just cheat. because cheating with copyMem matches the semantic we actually want. |
20:23:01 | Zevv | no. but if you do 'tmp = a; a = b; b = tmp', there will be no destructors? |
20:23:18 | Zevv | oh there will |
20:23:54 | Zevv | I'm still thinking too reffy |
20:23:59 | FromDiscord | <Clyybber> well ideally |
20:24:01 | FromDiscord | <Clyybber> there would be none |
20:24:19 | FromDiscord | <Clyybber> but that requires my unfinished firstWrite lastRead analysis |
20:24:25 | FromDiscord | <Clyybber> that does the whole thing in one go |
20:24:40 | FromDiscord | <Clyybber> and thus can detect lastRead/firstWrite pairs |
20:24:58 | disruptek | gah i don't even know if i buy that that's safe. |
20:25:04 | FromDiscord | <Clyybber> it is |
20:25:11 | FromDiscord | <Clyybber> oh no |
20:25:13 | FromDiscord | <Clyybber> wait |
20:26:28 | Zevv | so basically you want to properly detect this and tread these assignments as sinks? does that make sense? |
20:26:32 | FromDiscord | <Clyybber> you will need one copy there |
20:26:40 | FromDiscord | <Clyybber> hmm |
20:26:50 | FromDiscord | <Clyybber> unless we come up with some real smart shit |
20:27:23 | disruptek | we could technically optimize them out in cases where there's no backend interaction. |
20:27:44 | disruptek | doesn't seem worth the complexity. |
20:27:58 | FromDiscord | <Clyybber> sink(tmp, a), sink(a, b), sink(b, tmp) |
20:28:05 | Zevv | right? |
20:28:37 | FromDiscord | <Clyybber> its not safe for every type though |
20:28:47 | Zevv | for example? |
20:29:34 | FromDiscord | <Clyybber> a buffer whose sink operation moves the memory from src to dest and gives src back to the os |
20:29:50 | Zevv | when there's a real thing in there like a file descriptor, at a normal `=` you'd need a dup(), but at sink() you can just move the fd. |
20:30:20 | Zevv | well no, for a sink you keep the same memory buffer? |
20:30:29 | Zevv | so any refs or ptrs to there are still valid |
20:30:33 | FromDiscord | <Clyybber> its only safe for those that leave the src safe to reuse |
20:30:41 | FromDiscord | <Clyybber> Zevv: Well yeah, but imagine |
20:31:03 | FromDiscord | <Clyybber> maybe I'm overthinking it and it is really safe |
20:31:09 | FromDiscord | <Clyybber> oh yeah |
20:31:10 | FromDiscord | <Clyybber> it is |
20:31:23 | FromDiscord | <Clyybber> since because of lastread all of those sinks are just memcpys |
20:31:44 | FromDiscord | <Clyybber> eh firstWrite |
20:31:55 | Zevv | so |
20:33:25 | * | natrys quit (Quit: natrys) |
20:34:15 | disruptek | clyybber is trying to confuse you. |
20:34:25 | disruptek | it's simpler than it sounds. |
20:34:36 | Zevv | oh but I have been in a perpetual state of confusion for a long, long time already |
20:34:38 | FromDiscord | <Clyybber> yeah, I'm not in the right phase right now |
20:34:45 | FromDiscord | <Clyybber> semphase it is |
20:44:35 | Zevv | I understand this can print 'foo' zero times, or one time. http://ix.io/2uKu |
20:44:43 | Zevv | but two times seems magical to me |
20:45:06 | disruptek | just lucky, i guess. |
20:45:26 | FromDiscord | <Clyybber> lol? |
20:48:56 | Zevv | not sure. is it funny? |
20:49:07 | FromDiscord | <Clyybber> yeah |
20:49:10 | FromDiscord | <tomck> sent a long message, see http://ix.io/2uKx |
20:49:17 | disruptek | har har |
20:49:17 | FromDiscord | <Clyybber> its as funny as the bug I now tracked down |
20:49:22 | FromDiscord | <Clyybber> it fails with and |
20:49:25 | Zevv | oh you did |
20:49:28 | FromDiscord | <Clyybber> but not with anand = a and b |
20:49:40 | disruptek | tomck: right, cursor is weak in that it doesn't get managed. |
20:49:54 | disruptek | but it allows you to use refs and it may get some compile-time checks. |
20:50:00 | disruptek | ptr is completely unsafe. |
20:50:20 | Zevv | clyybber: lol? |
20:50:40 | disruptek | cursors have no refcount and cannot contribute to the refcounts of refs they ref. |
20:51:01 | FromDiscord | <Clyybber> Zevv: lol indeed, but tracking that whole thing down, I kinda want to delay to tomorrow hehe |
20:51:15 | FromDiscord | <Clyybber> at least now I got a 10 line repro |
20:51:25 | Zevv | dustified? |
20:51:28 | Zevv | or manual |
20:51:31 | FromDiscord | <Clyybber> manuallified |
20:51:51 | * | Trustable quit (Remote host closed the connection) |
20:51:52 | disruptek | tomck: you mean about exceptions that you wish you didn't have to catch a KeyError? |
20:52:01 | Yardanico | there's getOrDefault for that :P |
20:52:07 | Zevv | man I'm sitting outside with my laptop in some kind of nature reserve, the amount and size of critters on my screen is amazing |
20:52:20 | FromDiscord | <Clyybber> heh |
20:52:28 | disruptek | i just had to have a fight with a dragonfly. |
20:52:36 | Zevv | I smack some of then, and this hedgehog under my chair then goes crunchcrunch |
20:52:43 | Zevv | i feel so one with nature |
20:52:54 | FromDiscord | <Clyybber> disruptek: Lol, one just flew into my room half an hour ago |
20:52:57 | Zevv | disruptek: who won |
20:53:10 | disruptek | bentley is so useless. |
20:53:20 | FromDiscord | <Clyybber> my cat too |
20:53:22 | FromDiscord | <Clyybber> just gtfo |
20:53:36 | FromDiscord | <Clyybber> but its cool, dragonflies are cool |
20:53:36 | disruptek | a dragonfly in the rv is like having a bird in a normal-sized room. |
20:53:44 | Zevv | haha |
20:53:46 | FromDiscord | <Clyybber> haha |
20:53:53 | Zevv | I got an owl in the house once |
20:53:59 | Zevv | it was a small brand, but still |
20:54:05 | Zevv | it makes your living room look pretty small |
20:54:07 | disruptek | shit, that's a big bird. |
20:54:18 | Zevv | came in through the chimney, with all the soot |
20:54:19 | disruptek | and speaking of, they leave quite a mess. |
20:54:20 | disruptek | well, probably not owls. |
20:54:33 | disruptek | well, maybe sooty owls. |
20:54:37 | Zevv | they do :) |
20:55:54 | FromDiscord | <Clyybber> at least you don't have weasels screeching in front of your window at 3 am |
20:56:05 | FromDiscord | <Clyybber> they make a horrifying sound |
20:56:11 | FromDiscord | <Clyybber> when they fight |
20:56:22 | disruptek | i have a pack of coywolves in the woods. |
20:56:30 | FromDiscord | <Clyybber> oh, thats better |
20:56:31 | FromDiscord | <Clyybber> lol |
20:56:42 | disruptek | can't let bentley out at night, not that he'd go after them. the pussy. |
20:57:01 | FromDiscord | <Clyybber> smol boye |
20:57:15 | disruptek | foxes sound pretty crazy. what do weasels sound like? |
20:57:32 | FromDiscord | <Clyybber> like those typical woman horror movie screams |
20:57:40 | disruptek | awesome. |
20:57:46 | FromDiscord | <Clyybber> just a bit less human |
20:57:55 | Zevv | never heard them. did hear the cursing of my dad though when they chewed through the wiring of his car |
20:58:17 | FromDiscord | <Clyybber> oh yeah |
20:58:18 | Zevv | hm or were that ferrets, can't remember |
20:58:53 | FromDiscord | <Varriount> π¦ |
20:58:57 | FromDiscord | <Clyybber> marder |
20:59:01 | Zevv | yeah those |
20:59:59 | Zevv | "According to Gesamtverband der Deutschen Versicherungswirtschaft, a German auto insurance company, martens account for tens of millions of dollars cumulatively in damage to car cables each year." |
21:00:04 | FromDiscord | <Clyybber> weasels are a kind of marder |
21:00:38 | FromDiscord | <Clyybber> or whatever you call it in english |
21:00:46 | FromDiscord | <Clyybber> the dutch understand |
21:00:51 | FromDiscord | <Varriount> Why do they chew car cables? Are they environmental activists? |
21:01:16 | FromDiscord | <tomck> sent a long message, see http://ix.io/2uKC |
21:01:19 | Zevv | "Their territorial nature is the most likely explanation, where martens feel the need to exhibit dominance by marking objects, including cars, within their territorial area. |
21:01:34 | Zevv | i.e. "because they can" |
21:01:37 | Zevv | fuckers by nature |
21:01:43 | FromDiscord | <Clyybber> they also like the smell |
21:01:53 | FromDiscord | <Clyybber> and the warmth of the cars inside |
21:02:07 | Zevv | I do like the warmth of the cars inside |
21:02:20 | Zevv | not in summer tho. no airco :( |
21:02:20 | FromDiscord | <Clyybber> oh, actually, that seems to be debunked |
21:02:33 | disruptek | tomck: yeah, it's not the same as a weak ref. it's the closest thing arc has at the moment. |
21:02:36 | FromDiscord | <Clyybber> so your explanation is the right one |
21:02:57 | disruptek | !repo badresults |
21:02:59 | disbot | https://github.com/disruptek/badresults -- 9badresults: 11like results but worse 15 0β 0π΄ |
21:03:02 | disruptek | !repo nimresults |
21:03:03 | disbot | no results π’ |
21:03:09 | disruptek | !repo results |
21:03:10 | disbot | https://github.com/xyb/googlesearch.nim -- 9googlesearch.nim: 11Nim library for scraping google search results 15 4β 0π΄ 7& 8 more... |
21:03:10 | FromDiscord | <Clyybber> nice sales pitch |
21:03:28 | disruptek | there's another results lib that you may prefer. |
21:03:29 | FromDiscord | <Varriount> Zevv: Leave the windows slightly down in the summer. It keeps the car cool |
21:03:34 | FromDiscord | <Clyybber> you searching for arnes one? |
21:03:44 | disruptek | yeah. |
21:04:04 | FromDiscord | <tomck> Less about having results, i can implement those myself, but if it's not propogated through the stdlib/community libs they're basically useless (or at least very very awkward) |
21:04:22 | disruptek | tomck: if key in collection: ... is the same as if collection.contains key: is the same as if collection.hasKey key: |
21:04:34 | Zevv | Varriount: oh sure, having no arco made me learn a lot of tricks. I also have these rad 70's beads seats that totally match the beige/brown interior of my car |
21:05:14 | FromDiscord | <tomck> Yeah but that'll do two lookups - unless the optimiser is aware of Table? In which case, it'll do two lookups with any *other* data structures that aren't a Table |
21:05:38 | FromDiscord | <tomck> ```β΅if key in myTable:β΅ use(myTable[key]) ## Second lookupβ΅``` |
21:06:06 | disruptek | then you /do/ want getOrDefault or whatever. |
21:06:37 | disruptek | there is a convention of containsOrIncl on sets which does what you want, most like. |
21:07:17 | disruptek | anyway, it's a fair criticism and the stdlib is always the weak link. |
21:07:30 | Zevv | is there not some kind of block that only runs with the key of found? |
21:07:41 | FromDiscord | <tomck> Is the stdlib up for change? or is nim too stable now? |
21:07:55 | disruptek | the stdlib is always up for change. |
21:08:01 | FromDiscord | <tomck> The *big* issue is lack of good iterators imo, rust seems to handle them better |
21:08:03 | Zevv | tomck: new additions are frowned upon, changes and fixes are cool |
21:08:30 | Zevv | personally I find the Tables api already beyond hilarious |
21:08:47 | disruptek | it's pretty annoying that add was deprecated. |
21:08:59 | FromDiscord | <tomck> add is deprecated? |
21:09:08 | disruptek | in favor of []=, yes. |
21:09:13 | Zevv | we have one hundred and thirteen different exporetd procs in the Table module |
21:09:20 | disruptek | whatfer catering to people that cannot read docs. |
21:09:28 | Zevv | tomck: there was too much confusion over the ability of tables to store more then one value for a key |
21:09:42 | FromDiscord | <Elegant Beef> Yea i didint realize add was deprecated and found it weird that it was |
21:10:02 | FromDiscord | <Elegant Beef> but this is weird behaviour for add anywhoβ΅> Puts a new (key, value) pair into t even if t[key] already exists. |
21:10:08 | disruptek | shoulda just made a new dupe-free table that was more optimal. |
21:10:11 | FromDiscord | <tomck> not deprecated in the online docs, any other big deprecated things lol? |
21:10:16 | * | PMunch quit (Quit: leaving) |
21:10:22 | disruptek | it's deprecated in devel. |
21:10:36 | disruptek | probably won't be removed before 1.6 at the earliest. |
21:10:56 | FromDiscord | <tomck> oh i see, fair |
21:11:18 | Zevv | tomck: I'm not familiar with rust iterators, what's Nim missing you think? |
21:12:02 | FromDiscord | <tomck> rust doesn't have inline iter, it can just optimised closure iters very well ( i think?) |
21:12:05 | disruptek | i think he means first-class iterator operations like python. |
21:12:07 | * | Vladar quit (Quit: Leaving) |
21:12:10 | FromDiscord | <tomck> yes ^ |
21:12:19 | FromDiscord | <tomck> wait, closure iters aren't allocated right? |
21:12:44 | disruptek | what do you mean? |
21:12:58 | FromDiscord | <tomck> they can just be normal values too? (so in theory they *could* be optimised as well as rust's iters?) |
21:13:16 | FromDiscord | <tomck> wait, are closure iters even first class? |
21:13:37 | disruptek | i think so. |
21:13:44 | Zevv | 1.5 |
21:13:45 | FromDiscord | <tomck> i've never used closure iters, i don't know if there's some weird allocations / function pointers happening |
21:14:15 | Zevv | well they kind of are what the name implies. they are heavier then the skinny iterators |
21:14:37 | FromDiscord | <tomck> interesting, can you `.map` a closure iterator? or is it a completely dynamic thing? |
21:15:00 | disruptek | it's weird in that you get a ptr to the env, but that's hardly surprising. |
21:15:05 | Zevv | you need to toSeq them first, so they're not kind of 1.5 class indeed |
21:15:13 | disruptek | wut |
21:15:25 | Zevv | no? |
21:15:28 | disruptek | no. |
21:15:32 | Zevv | no! |
21:15:34 | disruptek | no! |
21:15:42 | FromDiscord | <Clyybber> sey |
21:15:44 | disruptek | you can map closure iterators. |
21:15:48 | FromDiscord | <Recruit_main707> yesn't |
21:15:57 | disruptek | i mean, you can pass them around and apply funcs and whatnot. |
21:16:17 | disruptek | but they aren't as full-featured as, say, python's generators. |
21:16:38 | disruptek | and they don't work at compile-time, which is kinda a big deal for nimions. |
21:17:14 | Zevv | I feel some cps coming up |
21:17:22 | disruptek | lol yeah |
21:17:24 | disruptek | !repo cps |
21:17:24 | FromDiscord | <tomck> hmmm so i'm going from this atm, not sure if it's outdated https://nim-by-example.github.io/for_iterators/β΅Just looks like there's a generic `iterator()` type, which seems to imply there's some kind of dynamic function pointer stuff going on? |
21:17:24 | disbot | https://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim π 15 29β 1π΄ |
21:17:32 | disruptek | this is our solution to the problem. |
21:17:59 | Zevv | if only clyybber would not sleep so much. like. every day. |
21:18:01 | Zevv | waste of time |
21:18:13 | FromDiscord | <tomck> wait they don't work at compile time? |
21:18:30 | FromDiscord | <Clyybber> truly |
21:18:33 | disruptek | closure iterators do not, no. |
21:18:52 | FromDiscord | <Clyybber> once you find out you don't need sleep |
21:19:03 | FromDiscord | <tomck> why? aren't they just a struct? |
21:19:09 | FromDiscord | <Clyybber> your mind goes wiiide |
21:19:17 | Zevv | dude. I never knew that |
21:19:20 | Zevv | TIL |
21:19:26 | Zevv | bet I'm not a nimion then |
21:19:27 | FromDiscord | <Recruit_main707> till it explodes |
21:19:34 | disruptek | i don't know enough about the front-end to say why this limitation exists. |
21:19:46 | disruptek | weirdly, i'm learning the compiler back-to-front. |
21:20:02 | FromDiscord | <Clyybber> https://www.youtube.com/watch?v=jANThtZJGrs |
21:20:20 | FromDiscord | <Clyybber> disruptek: The limitation exists because nobody implemented it |
21:20:22 | FromDiscord | <Clyybber> :P |
21:20:29 | disruptek | ~features |
21:20:29 | disbot | features: 11begin in the unfortunate state of /unimplemented/ -- disruptek |
21:20:54 | FromDiscord | <Recruit_main707> this is extremely fitting lol, how many times have you used it? |
21:21:32 | Zevv | "sorry state" |
21:21:33 | disruptek | it's one of my favorite quotes by araq. |
21:21:45 | Zevv | mine is "I don't know you" |
21:21:52 | disruptek | ~araq |
21:21:53 | disbot | Araq: 11πAndreas "What Else?" Rumpfπ -- disruptek |
21:21:56 | FromDiscord | <Recruit_main707> -- disruptek π€ |
21:22:02 | Zevv | don't do that, you'll wake him |
21:22:10 | FromDiscord | <tomck> so if i use closure iters, is it going to dynamic dispatch something, or call a function pointer? |
21:22:23 | disruptek | call a function pointer. |
21:22:41 | * | Jesin joined #nim |
21:22:45 | FromDiscord | <tomck> hmmmmm i see |
21:23:00 | disruptek | but cps gives you the best of both worlds. |
21:23:16 | FromDiscord | <tomck> i have no idea what a continuation is lol, i'm not that deep yet |
21:23:31 | disruptek | i thought you came from a functional lang. |
21:23:42 | Zevv | it's just a function pointer :) |
21:23:53 | FromDiscord | <Clyybber> \> mine is "I don't know you" hahahaha |
21:23:59 | FromDiscord | <tomck> Errr not so much |
21:24:07 | FromDiscord | <Clyybber> hey Zevv whats up |
21:24:19 | FromDiscord | <tomck> i do a bit of haskell, but don't know the lingo |
21:24:21 | Zevv | hehe |
21:24:31 | disruptek | a continuation is a fn* as well as the data it is passed. |
21:24:43 | disruptek | inside that data is the fn*. π |
21:25:51 | FromDiscord | <tomck> ohhhh are these just futures / promises? |
21:25:58 | FromDiscord | <tomck> maybe at a lower level? |
21:26:05 | disruptek | lower level, yes. |
21:26:29 | FromDiscord | <tomck> is this all static? |
21:26:53 | disruptek | i think the answer is yes but i'm not sure what you're asking. |
21:27:32 | FromDiscord | <tomck> Wait i haven't connected how these relate to first-class iterators |
21:27:34 | disruptek | it's static in that it's typed, but dispatch itself is dynamic. however, the model can be statically analyzed to assert that it's /safe/ for some measure of /safety/. |
21:27:44 | FromDiscord | <tomck> i see |
21:28:24 | FromDiscord | <tomck> does nim have something similar to typeclasses? So that I can implement a proc on all types which satisfy some typeclass? |
21:28:29 | disruptek | sure. |
21:28:44 | FromDiscord | <tomck> how do i go about doing that |
21:28:46 | disruptek | we also have concepts, which are aka interfaces in other languages. |
21:28:51 | FromDiscord | <Clyybber> proc(a: int or float) |
21:29:05 | disruptek | ~concepts |
21:29:05 | FromDiscord | <tomck> errr wait let me explain more |
21:29:05 | disbot | concepts: 11user-defined type classes; documented in the experimental section of the manual: https://nim-lang.org/docs/manual_experimental.html#concepts -- disruptek |
21:29:39 | FromDiscord | <tomck> ahhhhhh yes i think this is what i want - are concepts static dispatch? |
21:29:46 | disruptek | yes. |
21:30:05 | FromDiscord | <tomck> amazing! when're these getting stabilised? |
21:30:15 | FromDiscord | <Clyybber> they basically are already |
21:30:20 | FromDiscord | <tomck> Holy shit these are way more powerful than typeclasses i think |
21:30:20 | disruptek | they haven't changed in a couple years. |
21:30:41 | disruptek | i'm starting to use them because i'm tired of waiting for them to "stabilize". they will be stable enough. |
21:30:45 | FromDiscord | <Clyybber> tomck: They are quite literally infinitely powerful |
21:30:59 | * | audiofile quit (Ping timeout: 240 seconds) |
21:31:11 | FromDiscord | <Clyybber> because you can put all kinds of code into their body |
21:31:51 | disruptek | concepts * generics * statics do produce a pretty small head of the needle, however. |
21:32:38 | FromDiscord | <Varriount> It's only a shame that vtrefs never materialized |
21:33:20 | FromDiscord | <tomck> well this is mind blowing stuff |
21:33:31 | FromDiscord | <tomck> i shudder to consider the compile time lol |
21:33:45 | FromDiscord | <Elegant Beef> But sadly they arent runtime π |
21:33:48 | Zevv | https://www.lightningmaps.org/?lang=nl oooh coming straight at me, amazingly spooky having this much lightning on the horizon, but not hearing a thing yet |
21:34:13 | FromDiscord | <Clyybber> nice! |
21:34:36 | * | eery joined #nim |
21:35:04 | disruptek | the compile-time isn't too bad. |
21:35:28 | disruptek | nim compile-time is comparable to python's runtime. |
21:35:50 | FromDiscord | <Clyybber> heh, 2 lines now |
21:37:49 | FromDiscord | <tomck> This is great! I had no idea concepts were a thing |
21:37:54 | FromDiscord | <tomck> time to ruin my codebase |
21:38:02 | FromDiscord | <Clyybber> heh, to elevate you mean |
21:38:09 | FromDiscord | <Clyybber> they really are a great *concept* |
21:38:41 | disruptek | they're a little rough around the edges, but they work. |
21:39:42 | FromDiscord | <Clyybber> theres one thing you should know, concept refinement is in the manual, but not yet implemented |
21:39:51 | FromDiscord | <tomck> What's refinement? |
21:40:10 | FromDiscord | <tomck> oh like, 'this concept but with X too'? |
21:40:36 | FromDiscord | <Clyybber> yeah, basically inheritance/composition |
21:41:07 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2uKH |
21:41:16 | FromDiscord | <Clyybber> yep |
21:42:02 | FromDiscord | <Clyybber> you don't need the "hasFieldCalled" |
21:42:04 | FromDiscord | <tomck> do any other langs have concepts? (other than c++20) |
21:42:17 | FromDiscord | <Clyybber> probably, there are many langs in the sea |
21:42:21 | FromDiscord | <tomck> oh yeah i see, makes sense |
21:42:47 | FromDiscord | <tomck> any other 'legit' langs, that have a reasonable community |
21:42:59 | FromDiscord | <Clyybber> not that I'm aware of |
21:43:21 | FromDiscord | <tomck> cool! i'm surprised the uber-functional people haven't been flooding in |
21:43:33 | FromDiscord | <Clyybber> heh, they have been |
21:43:42 | FromDiscord | <Clyybber> even going as far as to request a subset of nim |
21:43:50 | FromDiscord | <Clyybber> that disallows procs and var |
21:44:09 | FromDiscord | <Clyybber> but we told them they can write a macro that disallows that stuff |
21:44:16 | FromDiscord | <tomck> lol |
21:44:33 | disruptek | newbies gonna newb. |
21:45:20 | FromDiscord | <tomck> this is cool, i never hear about nim anymore, does the GC push people away? this seems like a way better version of most of the current systems langs |
21:45:23 | * | solitudesf quit (Ping timeout: 265 seconds) |
21:45:37 | FromDiscord | <Clyybber> nim doesn't have coroporate backing |
21:46:00 | disruptek | it's ridiculous how many people are turned off by the fact that nim supports GC. and, it's like, you don't even have to use it. |
21:46:09 | disruptek | and there are several to choose from. |
21:46:11 | disruptek | and none of them suck. |
21:46:18 | FromDiscord | <Clyybber> its also ridiculous how many people think they need a gc |
21:46:55 | disruptek | i see the code these people write. |
21:46:59 | disruptek | c'mon, man. |
21:47:01 | FromDiscord | <tomck> i think it's the same problem that D had, where (afaik) the whole stdlib relied on the GC |
21:47:12 | FromDiscord | <tomck> that's what put me off all these years |
21:47:34 | disruptek | i'm surprised how competitive D and zig are. |
21:47:37 | FromDiscord | <tomck> ngl i still don't use the arc annotations, i don't understand how they work |
21:47:46 | FromDiscord | <Clyybber> you don't have to |
21:47:58 | FromDiscord | <Clyybber> sink can be inferred |
21:48:01 | FromDiscord | <tomck> Zig feels like it's growing huge, i thought D was dead now (?) |
21:48:29 | FromDiscord | <tomck> yeah, but i don't like not knowing lol |
21:48:38 | FromDiscord | <Clyybber> heh, read destructors.md |
21:48:40 | FromDiscord | <tomck> It's mainly `lent` |
21:48:47 | FromDiscord | <Clyybber> lent is like a view |
21:48:54 | FromDiscord | <Clyybber> but its not finished yet |
21:49:00 | FromDiscord | <tomck> i have done, what about this part: `lent T is like var T a hidden pointer. It is proven by the compiler that the pointer does not outlive its origin` |
21:49:08 | FromDiscord | <tomck> without lifetime annots i'm not even sure that's possible |
21:49:25 | * | lritter quit (Ping timeout: 264 seconds) |
21:49:25 | FromDiscord | <Clyybber> we will inferr that stuff |
21:49:35 | FromDiscord | <Clyybber> you don't need to explicitly annotate lifetimes |
21:50:07 | FromDiscord | <Clyybber> also because a lent is not guaranteed to stay a lent |
21:50:10 | FromDiscord | <Clyybber> its an optimization |
21:50:16 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2uKJ |
21:50:26 | FromDiscord | <tomck> Assuming `proc []` returns a `lent int` here |
21:50:34 | FromDiscord | <Clyybber> if you would do something that would outlive the lent we may copy |
21:50:41 | FromDiscord | <tomck> ohhhhh |
21:50:50 | FromDiscord | <Clyybber> but thats not set in stone |
21:50:57 | FromDiscord | <Clyybber> we are still designing it |
21:51:03 | FromDiscord | <tomck> ah i see, ok |
21:51:11 | FromDiscord | <Clyybber> but you can use it already |
21:51:23 | FromDiscord | <tomck> If there was a `lent {.nocopy.}` that'd work for me |
21:51:27 | FromDiscord | <Clyybber> it will just get less restrictive in the future |
21:52:11 | FromDiscord | <Clyybber> tomck: You can make your `=` {.error.} and that will prohibit all copies |
21:52:37 | FromDiscord | <tomck> eh? |
21:52:46 | FromDiscord | <Clyybber> but yeah, something like a lentNoCopy thing might be useful |
21:53:19 | FromDiscord | <tomck> ohhhhh, so the lent version of `[]` is implemented likeβ΅```β΅proc `[]`[T](x: lent seq[T]): lent T = ...β΅``` |
21:53:22 | FromDiscord | <tomck> the seq itself is lent |
21:53:41 | FromDiscord | <tomck> so if you just make the non-lent version error, it'll show you at compiletime? |
21:53:54 | FromDiscord | <Clyybber> it should yeah |
21:54:01 | FromDiscord | <Clyybber> it behaves like var currently |
21:54:07 | FromDiscord | <Clyybber> except that its not mutable |
21:54:08 | FromDiscord | <Clyybber> basically |
21:54:27 | FromDiscord | <Clyybber> currently cursors are this COW lent thing |
21:54:35 | FromDiscord | <Clyybber> IMO lent/view/cursor its all the same thing |
21:54:47 | FromDiscord | <Clyybber> I plan on unifying it |
21:55:43 | FromDiscord | <tomck> so if i have a `seq[T]`, can i get a `lent T`? |
21:55:52 | FromDiscord | <Clyybber> yeah |
21:55:54 | FromDiscord | <tomck> or do i need to explicitly 'borrow' the `set[T]`? |
21:56:00 | FromDiscord | <tomck> (edit) '`set[T]`?' => '`seq[T]`?' |
21:56:01 | FromDiscord | <tomck> how? |
21:56:03 | FromDiscord | <Clyybber> lent is a borrow |
21:56:41 | FromDiscord | <tomck> oh so nim will just try and call the `lent` version of the proc if possible, then if it decides it can't (via magic) it'll call the non-lent version? |
21:57:05 | FromDiscord | <Clyybber> I don't think that it does currently |
21:58:17 | FromDiscord | <Clyybber> yeah, currently it won't |
21:58:30 | FromDiscord | <tomck> currently it won't do what, call the lent version, or magically call the non-lent version? |
21:58:39 | FromDiscord | <Clyybber> magically the non-lent |
21:59:04 | FromDiscord | <tomck> ah ok, so it will segfault currently, but semantically it won't - just pending compiler changes? |
21:59:11 | FromDiscord | <Clyybber> no it won't segfault |
21:59:15 | FromDiscord | <Clyybber> it will error at compiletime |
21:59:26 | FromDiscord | <tomck> ohhh if it can't do the copy? i see |
22:00:05 | FromDiscord | <tomck> that's actually great, you should pop in a compiler flag to turn off auto-copy project wide, i wouldn't be touching that lol |
22:01:15 | FromDiscord | <tomck> and you could explicitly copy with .deepCopy to get around the compiler error i assume? |
22:05:02 | disruptek | #13804 |
22:05:04 | disbot | https://github.com/nim-lang/Nim/issues/13804 -- 3_ (underscore) is gensym'd inside templates, therefore gives unused warning ; snippet at 12https://play.nim-lang.org/#ix=2uKO |
22:05:06 | disruptek | this again |
22:05:20 | FromDiscord | <Clyybber> oh, yeah that ones been on my easy-fix lsit |
22:05:31 | FromDiscord | <Clyybber> but I'm so stuck with #5961 |
22:05:31 | disbot | https://github.com/nim-lang/Nim/pull/5961 -- 5'newEnum' proc |
22:05:35 | FromDiscord | <Clyybber> not stuck |
22:05:38 | FromDiscord | <Clyybber> and not that one |
22:05:39 | FromDiscord | <Clyybber> lol |
22:05:45 | disruptek | yeah, i know. |
22:05:51 | FromDiscord | <Clyybber> well, tomorrow will enlighten me hopefully |
22:06:06 | FromDiscord | <Clyybber> sleep/awake well people |
22:06:09 | FromDiscord | <Clyybber> cee ya |
22:06:12 | disruptek | gn |
22:15:00 | * | tane quit (Quit: Leaving) |
22:15:27 | * | arecacea1 quit (Remote host closed the connection) |
22:15:51 | * | arecacea1 joined #nim |
22:16:58 | * | thomasross joined #nim |
22:17:29 | FromDiscord | <brainproxy> is there a nim equiv of golang's `image`, `image/draw` packages? |
22:18:13 | disruptek | hard to say without being familiar with those packages. |
22:21:38 | FromDiscord | <brainproxy> this seems promising: https://github.com/Ethosa/nimage |
22:22:03 | disruptek | !repo imageman |
22:22:04 | disbot | https://github.com/SolitudeSF/imageman -- 9imageman: 11Image manipulation library 15 41β 3π΄ |
22:26:33 | FromDiscord | <stisa> https://github.com/treeform/flippy too maybe? |
22:34:34 | shashlick | local deps only needs readme updates, then it's a go |
22:36:49 | * | abm quit (Quit: Leaving) |
22:36:51 | * | zyklon joined #nim |
22:51:49 | FromDiscord | <hobbledehoy> would anyone know why dochack.js is not getting outputted with `nim doc`? |
23:13:14 | FromDiscord | <hobbledehoy> found the issue, 1.2.6 doesn't output, switching to devel fixed it |
23:13:36 | disruptek | shashlick: nice job, dude. |
23:18:19 | * | selk joined #nim |
23:19:30 | * | arecacea1 quit (Remote host closed the connection) |
23:19:49 | * | arecacea1 joined #nim |
23:22:47 | shashlick | https://github.com/nim-lang/nimble/blob/0dc46e92d33fa6ed6e8e52de4dc75cf99947fb95/readme.markdown#nimbles-folder-structure-and-packages |
23:25:53 | * | endragor joined #nim |
23:26:32 | * | rockcavera quit (Remote host closed the connection) |
23:30:06 | * | Jesin quit (Quit: Leaving) |
23:34:23 | * | opal quit (Ping timeout: 240 seconds) |
23:39:34 | disruptek | why can't you just put --nimblePath="nimbledeps" into your nim.cfg so the compiler picks them all up? |
23:39:49 | disruptek | nimble should be allowed to clobber that file, right? |
23:40:11 | disruptek | shashlick ^ |
23:40:46 | * | endragor quit (Ping timeout: 258 seconds) |
23:42:53 | * | rockcavera joined #nim |
23:43:15 | * | krux02_ joined #nim |
23:45:23 | FromDiscord | <dom96> pretty sure that's the plan for the future |
23:46:08 | disruptek | the text makes it sound like nimble doesn't support that, but afaik it does. |
23:46:17 | * | krux02 quit (Ping timeout: 260 seconds) |
23:51:36 | disruptek | you know the worst mistake i made with nimph? |
23:51:51 | disruptek | not using AbsoluteDir and AbsoluteFile from the start. |
23:53:37 | * | awe002 quit (Ping timeout: 264 seconds) |
23:55:36 | * | hnOsmium0001 quit (Ping timeout: 246 seconds) |
23:56:35 | * | endragor joined #nim |
23:59:58 | * | hnOsmium0001 joined #nim |