00:53:07 | * | mbomba joined #nim |
01:17:31 | * | Tanger joined #nim |
01:44:04 | * | abm quit (Read error: Connection reset by peer) |
01:53:40 | * | mbomba quit (Quit: WeeChat 2.9) |
02:06:23 | * | unihernandez22 joined #nim |
02:12:38 | * | apahl quit (Ping timeout: 264 seconds) |
02:14:30 | * | apahl joined #nim |
02:23:47 | FromDiscord | <courtier> i know ive been bugging you people but can anyone help me with pkcs5 padding? |
02:44:15 | * | jrhawley[m] joined #nim |
03:01:35 | * | mbomba joined #nim |
03:14:26 | * | muffindrake quit (Ping timeout: 264 seconds) |
03:16:33 | * | muffindrake joined #nim |
03:19:25 | * | a_chou joined #nim |
03:23:05 | * | a_chou quit (Remote host closed the connection) |
03:27:48 | FromGitter | <sealmove> What is NimCEF? |
03:28:54 | FromGitter | <sealmove> Chromium? |
03:29:06 | Prestige | Where did you see that? |
03:31:27 | FromDiscord | <Yardanico> !repo nimcef |
03:31:28 | disbot | https://github.com/jangko/nimCEF -- 9nimCEF: 11Nim wrapper for the Chromium Embedded Framework 15 22⭐ 1🍴 |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:38 | * | supakeen joined #nim |
04:46:35 | FromDiscord | <flywind> Is it possible to implement closure iterator for JS backend? |
04:47:42 | FromDiscord | <flywind> JS backend could error for closure iterator anyway. |
04:47:49 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2CKz |
04:54:58 | * | vicfred quit (Quit: Leaving) |
05:04:44 | * | unihernandez22 quit (Quit: leaving) |
05:11:04 | FromDiscord | <PizzaFox> surely the `algorithm` lib should use cool timsort instead of cringe iterative merge sort |
05:12:48 | FromDiscord | <PizzaFox> i so no real reason to use a mergesort |
05:13:10 | FromDiscord | <PizzaFox> timsort is the same but has a best case of O(n) instead of O(n log n) |
05:13:53 | FromDiscord | <PizzaFox> (edit) "so" => "see" |
05:14:43 | FromDiscord | <ElegantBeef> Just use stalinsort and get O(1) |
05:14:57 | FromDiscord | <ElegantBeef> Sorry O(n) constantly |
05:30:32 | * | keisterfish is now known as disruptek |
05:35:00 | * | letto quit (Quit: Konversation terminated!) |
05:36:54 | * | letto joined #nim |
05:38:40 | * | mbomba quit (Quit: WeeChat 2.9) |
05:47:43 | * | astronavt quit (Quit: Leaving) |
05:52:26 | * | narimiran joined #nim |
05:54:24 | * | apahl quit (Ping timeout: 240 seconds) |
05:55:44 | * | apahl joined #nim |
06:24:57 | FromDiscord | <Idefau> an empty list is a sorted list! |
06:25:37 | FromDiscord | <Revenant> i want to log all Defects before exit, how do i do that? use case is i want to write the stacktraces to a log file so users can submit it with the bug reports if the app crashes |
06:32:04 | FromDiscord | <Revenant> ignore... figured out i can catch Exceptions too, not just CatchableErrors... |
06:41:03 | FromDiscord | <nikki> is there a quick way to do bitwise or 🤔 i have some constants to pass to SDL and i wanted to 'or' them |
06:41:05 | FromDiscord | <Rika> Defects can be caught by default, but there is a mode where you cannot |
06:41:08 | FromDiscord | <nikki> or do i have to go through a bitset |
06:41:15 | FromDiscord | <Rika> `or` is bitwise when done with numbers |
06:41:30 | FromDiscord | <Rika> there is also a module called `bitops` that defines a proc `bitor` |
06:42:00 | FromDiscord | <Rika> !eval echo 2 or 5 |
06:42:04 | NimBot | 7 |
06:42:07 | FromDiscord | <nikki> awesome thanks 😄 |
07:04:11 | * | Tlangir joined #nim |
07:06:47 | * | Tanger quit (Ping timeout: 260 seconds) |
07:08:01 | * | solitudesf joined #nim |
07:14:53 | FromDiscord | <shashlick> @leorize - this rpath nonsense is a nightmare - got it working on linux, but osx has its own way of doing things, and windows is also completely different |
07:33:53 | FromDiscord | <Yardanico> Yesss there is technical possibility |
07:33:59 | FromDiscord | <Yardanico> Fiber to my flat |
07:34:04 | FromDiscord | <Yardanico> 500mbp |
07:34:06 | FromDiscord | <Yardanico> s |
07:47:03 | Zevv | dude stop boasting about your russion internets |
07:47:09 | Zevv | we know, right :) |
07:47:28 | FromDiscord | <Yardanico> No you don't get it |
07:47:37 | FromDiscord | <Yardanico> I've max had 100mbps in my life |
07:47:42 | FromDiscord | <Yardanico> and now 500 |
07:47:49 | FromDiscord | <Yardanico> it's cheap yes |
07:48:01 | FromDiscord | <Yardanico> But need a media converter and a router (which I already bought) |
07:49:00 | FromDiscord | <lqdev> yardardanico shut up, i have to put up with a shitty 10Mbps connection on a daily basis where usually it reaches less than 5Mbps |
07:49:14 | FromDiscord | <lqdev> 100Mbps would be a miracle living in such a shithole |
07:49:21 | Zevv | don't let disruptek hear you guys |
07:49:30 | Zevv | he's on 64Kbit with a 200Mb daily cap |
07:49:40 | FromDiscord | <lqdev> zevv you fool |
07:49:44 | FromDiscord | <lqdev> you just called him!! |
07:49:50 | Zevv | he's asleep |
07:51:30 | FromDiscord | <lqdev> oh |
07:55:23 | FromDiscord | <Rika> ~~your media converter can be your router if its strong enough~~ |
07:56:17 | * | vicfred joined #nim |
07:58:07 | * | Vladar joined #nim |
07:59:11 | * | PMunch joined #nim |
08:01:01 | Zevv | fiber to ethernet is common gear these days, right? |
08:01:35 | Zevv | from there on it's typically PPPoE, so you just route it through some linux thing and do your routing and NAT there |
08:08:18 | PMunch | Hmm, started getting this error on 1.4.0: Error: cannot use symbol of kind 'param' as a 'var' |
08:09:23 | PMunch | Probably because I'm lifting type information from a getImpl |
08:18:49 | PMunch | Is there a way to de-sym a tree? |
08:19:06 | PMunch | Basically I have this: http://ix.io/2CLc |
08:19:21 | PMunch | But I'd want those syms to be idents |
08:21:29 | FromDiscord | <lqdev> get an untyped AST in the first place? |
08:21:54 | FromDiscord | <lqdev> walk the AST and replace every node.kind == nnkSym with an ident(node.strVal)? |
08:21:57 | PMunch | Well I get it from getImpl.. |
08:22:10 | PMunch | Yeah that's what I'm implementing now.. |
08:22:29 | PMunch | But it's a bit annoying that this worked in 1.2.6 |
08:22:46 | PMunch | And now I need to implement my own tree walker to undo something |
08:26:58 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
08:29:47 | * | Lord_Nightmare joined #nim |
08:30:40 | PMunch | This did the trick: http://ix.io/2CLe |
08:30:45 | PMunch | But still, quite annoying.. |
08:35:32 | FromDiscord | <Yardanico> @Rika good joek |
08:35:38 | FromDiscord | <Yardanico> but I think they'll provide their own one |
08:35:57 | FromDiscord | <Yardanico> the problem with buying media converters myself is that then I need to know the exact wavelengths |
08:36:00 | FromDiscord | <Yardanico> of the fiber connection |
08:42:02 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:05:19 | * | Tlangir quit (Quit: Leaving) |
09:16:39 | * | krux02 joined #nim |
10:26:22 | * | lum_but_somethin joined #nim |
10:29:35 | * | Vladar quit (Quit: Leaving) |
10:29:37 | * | lum quit (Ping timeout: 260 seconds) |
10:36:09 | * | Tanger joined #nim |
10:42:43 | * | apahl quit (Quit: WeeChat 2.7) |
10:44:08 | * | apahl joined #nim |
10:59:28 | * | abm joined #nim |
11:07:22 | ForumUpdaterBot | New thread by Clonk: Generating code coverage with Nim 1.4.0, see https://forum.nim-lang.org/t/7024 |
11:09:23 | FromDiscord | <Yardanico> turns out I've been bamboozled and they just give me a 4-pair ethernet cable (gigabit) |
11:09:28 | FromDiscord | <Yardanico> Which is very good |
11:09:36 | FromDiscord | <Yardanico> I wouldn't need to care about all the optic stuff |
11:09:39 | FromDiscord | <Rika> thonk |
11:09:49 | FromDiscord | <Yardanico> Just plug into router and good to go |
11:11:33 | Zevv | PMunch: I have no clue what you're doing, I guess your macros are typed? |
11:15:02 | PMunch | Zevv, nope. I was getting the signature of a procedure that I only had the symbol for by doing `getImpl`. Then I extracted the arguments `id: int, test: string` for example and added that to a var block. This used to work fine when the `getImpl` returned IdentDefs had Idents in it, but somewhere between 1.2.6 and 1.4.0 this changed to be symbols instead. So now `id` and `test` are symbols with the `param` symbol kind, and thus I can't copy them |
11:15:02 | PMunch | directly into the variable block. |
11:16:02 | PMunch | I "fixed" this by "de-symming" the `getImpl` return: https://github.com/docopt/docopt.nim/pull/51/commits/2fdff42518c891422609edcbb14b800d6c41cfe1 |
11:16:03 | disbot | ➥ Add procedure dispatch module |
11:25:51 | FromDiscord | <Vindaar> PMunch: As far as I'm aware that's the only way to do it. I do it that way where required and I know mratsim does the same |
11:26:51 | FromDiscord | <Vindaar> imo there should be a helper for this in the macros module "unsymTree" or something |
11:31:09 | PMunch | Agreed! |
11:31:54 | PMunch | Feel free to take my `deSym` procedure there and PR it to the macros module |
11:36:24 | Zevv | maybe we also can make a `reSym` so disruptek can finish cps |
11:52:07 | PMunch | `reSym`? |
12:05:45 | Zevv | We need syms where we only have idents :) |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:42 | * | supakeen joined #nim |
12:09:42 | PMunch | Aha, that is a bit trickier :P |
12:16:45 | * | narimiran quit (Ping timeout: 240 seconds) |
12:18:05 | * | narimiran joined #nim |
12:34:05 | * | lritter joined #nim |
12:38:49 | * | TomDotTom joined #nim |
12:44:24 | * | Kaivo quit (Quit: WeeChat 2.9) |
12:47:14 | Araq | I wrote unsem() myself too... |
12:48:57 | * | Tanger quit (Remote host closed the connection) |
12:49:54 | FromDiscord | <g5becks> Who do I reach out to about my forum account? |
12:50:06 | FromDiscord | <g5becks> I signed up a week ago. |
12:50:25 | * | Kaivo joined #nim |
12:50:26 | FromDiscord | <g5becks> But didn’t verify my email for about 2 days |
12:50:31 | PMunch | @dom96 ^ |
12:50:57 | FromDiscord | <g5becks> @dom96 |
12:51:28 | FromDiscord | <g5becks> When you get a chance. I need to be able to get a new activation link. |
12:52:22 | FromDiscord | <g5becks> On a side note. It’s probably a good idea to be able to resend an activation link from within the forum. |
12:55:48 | PMunch | Yeah, the sign up process to the forum is a bit of a mess sometimes |
12:57:52 | * | sealmove joined #nim |
12:58:10 | sealmove | guys, is it possible to detect an Option type with the `is` operator? |
13:01:32 | mipri | yes, just the way you'd do it. |
13:01:43 | mipri | are you asking if there's a way to detect if it's any kind of Option[T] type, without knowing the T? |
13:01:55 | sealmove | yeah |
13:02:11 | mipri | yeah, no idea. How would you even receive the thing to ask the question? |
13:02:38 | FromDiscord | <Rika> I'll try something |
13:03:16 | FromDiscord | <Rika> !eval import options; echo some(0) is Option |
13:03:19 | NimBot | true |
13:03:24 | sealmove | oh `let x = some(2); when x is Option:` works |
13:03:31 | sealmove | yeah nice |
13:03:35 | FromDiscord | <Rika> !eval import options; echo 0 is Option |
13:03:38 | NimBot | false |
13:03:45 | FromDiscord | <Rika> there |
13:04:28 | sealmove | man this is so convinient |
13:05:47 | mipri | ah I only tried stuff like Option[_], Option[T] (with no T defined) |
13:07:15 | mipri | I was thinking that it'd be nice if the discriminant could be "whether the pointer is null", but what options.nim does with `when is SomePointer` works well enough, too |
13:08:07 | sealmove | when I implement TLV, nimitai will be pretty much ready-to-use :D |
13:08:37 | mipri | TLV? |
13:09:05 | sealmove | "type-length-value", will be mapped to object variants in nim |
13:11:06 | sealmove | basically it means that the object's type is determined at runtime |
13:11:30 | sealmove | for example you parse field x, and x tells you what type y is |
13:12:52 | sealmove | Kaitai Struct semantics map really nicely to Nim's object variants. |
13:16:05 | sealmove | https://gist.github.com/sealmove/080f54337a92d24e5ab6c8d61ffe8ecf |
14:10:09 | FromDiscord | <Grzegorz Brzęczyszczykiewicz> Why is exception handling disabled on os:standalone? |
14:49:16 | FromDiscord | <lqdev> i created a nim syntax plugin for rxi/lite: https://gist.github.com/liquid600pgm/3021d27a038fe701539523042a5f65e5#file-language_nim-lua |
14:49:27 | FromDiscord | <lqdev> gonna be trying out that editor for the next few days |
14:54:34 | * | madpata joined #nim |
15:11:20 | * | oprypin quit (Remote host closed the connection) |
15:15:26 | * | oprypin joined #nim |
15:27:35 | disruptek | Zevv: there's a desym() and a resym() in cps already. |
15:27:54 | disruptek | what we really need is bug fixes, not new lines. |
15:29:00 | FromDiscord | <Grzegorz Brzęczyszczykiewicz> So I've been tweaking the standard library to try to get exceptions to work in os:standalone for wasm, and I managed to make it work, more or less. The exception tests pass (I haven't tested cpp exceptions tho), except for tfinally4. It seems that when you return from a finally block, the exception is supposed to be muted (and that is the behavior for normal builds), but in this case the caller caught the exception. |
15:29:33 | Zevv | disruptek: did you tell clyybber yet? |
15:29:56 | FromDiscord | <Clyybber> still busy with the untyped method call fix |
15:30:10 | FromDiscord | <Clyybber> Araq: What are you worried about? |
15:30:21 | FromDiscord | <Clyybber> Araq: And what is your semityped idea? |
15:31:16 | FromDiscord | <Clyybber> Ah, i think I remember. But I don't see how its related |
15:34:01 | FromDiscord | <Clyybber> also, can we get the mangling back up? |
15:38:55 | disruptek | nah, i've wasted too much of my life on it. |
15:39:17 | FromDiscord | <Clyybber> it should not go to waste |
15:39:18 | disruptek | i'm not expected to live all that much longer and i have more i want to do. |
15:43:11 | PMunch | @Clyybber, did you see that I fixed the notificatcher thing? |
15:43:24 | PMunch | By writing a `deSym` procedure |
15:43:33 | FromDiscord | <Clyybber> ah, yeah. |
15:44:29 | FromDiscord | <Clyybber> macros.nim should probably have such a thing |
15:44:36 | PMunch | Yup |
15:44:51 | PMunch | We've all agreed, but none of us could be arsed to actually PR it it seems :P |
15:45:46 | * | hnOsmium0001 joined #nim |
15:49:08 | PMunch | For all the "Oooh Python is so easy" comments there are surprisingly many pitfalls in it |
15:49:19 | Zevv | use Lua instead |
15:49:32 | PMunch | No automatic stringification, case sensitivity, etc |
15:50:09 | Zevv | try to do some async I/O |
15:50:10 | PMunch | I'm helping my sister with some programming assignment |
15:50:13 | mipri | Python being easy is like your uncle still believing that you weigh 8 pounds because the last time he saw you was when you were a baby |
15:50:24 | PMunch | And she keeps messing up the casing <_< |
15:50:36 | Zevv | caSe maTters! |
15:50:48 | Zevv | let's make fun of all of the languages that don't do Nim casing |
15:50:50 | Oddmonger | yäh Lua with löve2D |
15:50:52 | Zevv | ha ha joke's on you guys! |
15:54:07 | * | Vladar joined #nim |
15:56:38 | disruptek | laughing all the way to the tiobe 100. |
15:57:43 | mipri | Nim's there, it's in "the next 50 programming languages" after 1..50 |
15:58:04 | * | leorize quit (Remote host closed the connection) |
15:58:59 | * | leorize joined #nim |
15:59:46 | PMunch | And what is the deal with `",".join(map(str, xValues))`? |
16:00:06 | PMunch | `xValues.map($).join(",") is so much more readable.. |
16:01:30 | mipri | does that actually work, though? |
16:01:43 | PMunch | Of course it does |
16:01:56 | mipri | with what imports? |
16:02:22 | PMunch | !eval import sequtils, strutils; echo [1, 2, 3].map(`$`).join(",") |
16:02:24 | NimBot | Compile failed: /usercode/in.nim(1, 48) Error: '$' cannot be passed to a procvar |
16:02:31 | PMunch | !eval import sequtils, strutils; echo [1, 2, 3].mapIt($it).join(",") |
16:02:35 | NimBot | 1,2,3 |
16:02:41 | PMunch | I swear that used to work with only map |
16:03:18 | FromDiscord | <Clyybber> !eval import sequtils, strutils; echo [1, 2, 3].map(`$`[int]).join(",") |
16:03:20 | NimBot | Compile failed: /usercode/in.nim(1, 42) Error: type mismatch: got <array[0..2, int], proc (x: openArray[int]): string{.noSideEffect, gcsafe, locks: 0.} | proc (x: seq[int]): string{.noSideEffect, gcsafe, locks: 0.} | proc (x: set[int]): string{.noSideEffect, gcsafe, locks: 0.}> |
16:04:57 | FromDiscord | <kodkuce> is status good |
16:13:56 | * | Jesin quit (Ping timeout: 268 seconds) |
16:15:21 | disruptek | fair question. |
16:18:35 | Zevv | well, is it |
16:24:18 | disruptek | i think one of my socks is smellier than the other. |
16:24:22 | disruptek | that's a thing, right? |
16:29:54 | Zevv | it sure is |
16:30:02 | Zevv | but usually it goes away after puberty |
16:30:27 | narimiran | :D :D |
16:42:58 | FromGitter | <iffy> @ftsf thanks for making NICO! I just made a game/simulation with it: https://www.iffycan.com/stealtheelection/index.html |
16:44:25 | supakeen | Yea, Nico is *great*. |
16:47:28 | FromDiscord | <Avatarfighter> disruptek: just make the socks smell the same smhhh |
17:01:25 | * | sealmove quit (Ping timeout: 264 seconds) |
17:03:45 | * | narimiran quit (Ping timeout: 240 seconds) |
17:37:05 | FromDiscord | <MiniApple> is there some easy game library |
17:42:38 | PMunch | Well, Nico should be pretty easy |
17:45:20 | nikki93 | PMunch: do you happen to test nimlsp on windows much? like test with interactive use in an editor (vs. just headless testing of the server) |
17:45:34 | PMunch | Nope |
17:45:43 | PMunch | I test it on Linux by using it daily |
17:46:11 | PMunch | But I know some people run it on Windows, and I think they use it pretty often |
17:46:28 | nikki93 | yeah it's been p good for me on linux and mac. on windows i had to do some fiddling of the path <-> uri handling to get "goto def" working-- https://github.com/nikki93/nimlsp/commit/06550873b790d2eac208e6dd343d0c255817f746 |
17:47:02 | nikki93 | but even after that; in a file it shows me errors on `import sibling_file` |
17:47:25 | PMunch | Hmm, that's not good |
17:47:57 | nikki93 | why would sibling file import fail / how could i dig into that? |
17:48:00 | FromDiscord | <shashlick> is it possible to run code before nimLoadLibrary() runs |
17:48:18 | nikki93 | the fix above was just my attempts when pushing through it and i'm a nim noob so the code isn't as good as it could be |
17:49:26 | PMunch | Well it could be issues with the project file detection |
17:50:42 | nikki93 | yeah -- i wasn't using nimble or anything in this project; just `nim cpp` on a main file and it finds siblings |
17:50:54 | nikki93 | there's a 'nim.cfg' adjactent to it tho |
17:51:17 | nikki93 | oh: building the project works totally fine on windows. just nimlsp issues |
17:51:24 | PMunch | @MiniAppl, there is also Enu |
17:51:48 | FromDiscord | <MiniApple> Enu? |
17:51:58 | PMunch | You asked for simple game libraries? |
17:52:02 | PMunch | I suggested Nico |
17:52:03 | FromDiscord | <MiniApple> yes |
17:52:21 | FromDiscord | <MiniApple> but i didn't have pico-8 |
17:52:22 | PMunch | Also nimgame2, but that is a bit more advanced |
17:52:26 | PMunch | Have? |
17:52:50 | PMunch | This was posted about an hour before you asked: https://www.iffycan.com/stealtheelection/index.html |
17:52:54 | PMunch | It is written in Nico |
17:53:08 | FromDiscord | <MiniApple> ok thank |
17:55:38 | nikki93 | if i just go to an empty directory with no nim stuff on the path to it, then make a .nim file there, what should the project file for that be, PMunch ? just that file itself? |
17:55:52 | PMunch | Ye |
17:55:58 | FromDiscord | <courtier> @ftsf thanks for making NICO! I just made a game/simulation with it: https://www.iffycan.com/stealtheelection/index.html↵@iffy verry fun game actually |
17:57:19 | FromDiscord | <MiniApple> do i need pico-8 to use nico? |
17:57:43 | PMunch | Nope |
17:58:03 | FromDiscord | <MiniApple> wow |
17:59:11 | PMunch | https://github.com/ftsf/nico#installation |
18:05:58 | FromGitter | <sealmove> PMunch: once i tried to help someone with programming and he was putting spaces between a single identifier, for example he was writing `my X` instead of `myX` |
18:06:37 | Zevv | so why is that funny |
18:07:40 | FromGitter | <sealmove> didn't say it's funny, but it did surprise me. I mean he was studying computer science and was even beyond first semester |
18:08:00 | FromGitter | <sealmove> then you have to take a big step back and explain basics |
18:08:10 | Zevv | CS != engineering |
18:08:20 | Zevv | I bet he can sort a linked list like no one else |
18:08:31 | FromGitter | <sealmove> maybe |
18:08:58 | FromDiscord | <dom96> I mean... first semester I wouldn't even be surprised if students can't even create a hello world app |
18:09:14 | * | tane joined #nim |
18:09:18 | Zevv | today I spent my day debugging someone's own C++ STL implementation that's part of our project. Fancy ownership passing on realloc going belly up. That was a fun day. |
18:09:29 | FromDiscord | <dom96> there are many people who take Computer Science with absolutely no prior knowledge of programming at all |
18:09:38 | Zevv | I whisper "... nim ..." in their ears every now and then, but they do not hear me |
18:09:49 | FromGitter | <sealmove> the assignment was to make an image parser in C++ :D (of some simple format like tga) |
18:10:05 | FromDiscord | <patasuss> First semester students should be required to have implemented their own OS and Compiler from scratch! /s |
18:10:19 | * | narimiran joined #nim |
18:12:13 | FromDiscord | <Avatarfighter> Just used a template in my code and its actually useful 😎 |
18:12:52 | FromDiscord | <Recruit_main707> Cool guy moment |
18:13:50 | FromGitter | <sealmove> guys do you like options? or prefer to use a secord bool for tracking, or some other way? |
18:14:13 | FromGitter | <sealmove> second* |
18:14:48 | * | Jesin joined #nim |
18:15:28 | Zevv | well, given the options... |
18:15:41 | FromGitter | <sealmove> xD |
18:15:48 | Zevv | I do like the idea of options, but I hate the 'some' and 'none' stuff that comes with it |
18:15:58 | FromDiscord | <patasuss> I like using Option. Allows for some terser code. |
18:17:31 | FromDiscord | <patasuss> I opened a PR in the packages repo (#1670) 19 days ago and there's no more updates on it. Would it be bad practice to ask about it in the PR's comments. |
18:17:31 | disbot | https://github.com/nim-lang/Nim/issues/1670 -- 5Better error message when attempting to define 'object' consts |
18:17:51 | PMunch | sealmove, that is crazy. Our first semester was programming some simple stuff in C.. |
18:18:09 | PMunch | Zevv, you can always use converter ;) |
18:18:22 | FromGitter | <sealmove> "beyond first semester", he wasn't first semester |
18:18:23 | FromDiscord | <patasuss> don't wanna seem to pushy |
18:18:25 | Zevv | PMunch: for what? |
18:18:34 | PMunch | For Options |
18:18:44 | Zevv | hmmm |
18:18:52 | PMunch | Sealmove, yeah I know you said that, that's the crazy part :P |
18:18:57 | PMunch | If it was the first semester I would understand it |
18:19:41 | FromGitter | <sealmove> Let me explain: Nimitai has feature of "conditional fields", which means when you are parsing, some field might exist or no exist depending on some info that you parsed earlier. But since the whole thing is represented with a type, the field must be declared anyway. So should it be an Option? Or should I declare 2 field, for example `myField` and `isMyField`? |
18:21:37 | PMunch | Hmm, depends on how much you need to check on it |
18:21:38 | Zevv | hmm I guess options come pretty natural for something like that |
18:21:40 | FromDiscord | <dom96> options are brilliant |
18:21:59 | FromGitter | <sealmove> PMunch how would you do it for your binaryparser generator? :P |
18:22:18 | FromGitter | <sealmove> I don't know how often it will be checked, I am only exposing the API |
18:23:51 | PMunch | Well if it is always present when the first flag is present then an Option would be best |
18:24:17 | PMunch | brb |
18:25:22 | FromGitter | <sealmove> ok poll completed, you all vote Option, thanks this really helps! :) |
18:32:13 | FromDiscord | <g5becks> @dom96 |
18:32:42 | FromDiscord | <g5becks> Anyway I can get another link to activate me email on the forum? |
18:34:11 | FromDiscord | <dom96> I activated it for you |
18:34:59 | FromDiscord | <g5becks> Thanks |
18:38:25 | Zevv | sealmove: we will all whine about it by the time you are done and we start actually using it |
18:41:25 | PMunch | They aren't the most ergonomic thing.. |
18:43:43 | FromGitter | <sealmove> As long as you use it I don't care! |
18:44:06 | FromGitter | <sealmove> Can change it if most people dislike it |
18:45:04 | FromGitter | <sealmove> One of these days it will be ready :> Only 1 crucial feature is missing atm. |
18:45:45 | FromGitter | <sealmove> And oh well, we still don't have a yaml parser so you will have to use it with json. |
18:46:08 | FromGitter | <sealmove> Although flyx's comments are encouraging: https://github.com/flyx/NimYAML/issues/70 |
18:46:10 | disbot | ➥ how much work needed to make it work at compile time? ; snippet at 12https://play.nim-lang.org/#ix=2COc |
19:04:33 | * | leorize quit (Quit: WeeChat 2.9) |
19:08:56 | * | mmohammadi9812 quit (Quit: Quit) |
19:16:53 | FromDiscord | <haxscramper> @dom96 I was told I should ask you about this |
19:21:47 | FromDiscord | <alehander42> oii |
19:22:30 | FromDiscord | <g5becks> Does anyoune know if there is a way to represent an anonymous object type in nim? |
19:22:39 | FromDiscord | <g5becks> Similar to go |
19:23:01 | FromDiscord | <haxscramper> `var v: tuple[field1: type, field2: type2]` |
19:23:06 | FromDiscord | <g5becks> or typescript |
19:23:19 | FromDiscord | <g5becks> makes sense |
19:23:32 | FromDiscord | <g5becks> I need to check how this translates to js |
19:23:37 | FromDiscord | <g5becks> @haxscramper |
19:23:40 | FromDiscord | <g5becks> thanks |
19:27:04 | FromDiscord | <haxscramper> > I was told I should ask you about this↵About survey dates to be precise |
19:32:42 | * | Vladar quit (Quit: Leaving) |
19:42:28 | FromDiscord | <alehander42> hey |
19:42:38 | FromDiscord | <alehander42> do you use the javascript backend @g5becks |
19:42:53 | FromDiscord | <alehander42> if so, then you can just use `JsObject` |
19:43:02 | FromDiscord | <alehander42> if you need interop |
19:43:05 | FromDiscord | <alehander42> if not, tuples are better |
19:45:55 | FromDiscord | <g5becks> @alehander42 I am writing a cli to convert typescript definition files to nim wrappers |
19:46:11 | FromDiscord | <g5becks> In typescript, you might find code that looks like this |
19:46:47 | * | mbomba joined #nim |
19:46:51 | FromDiscord | <g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COA |
19:47:26 | FromDiscord | <g5becks> My intuition tells me that the equivalent nim code would be this |
19:47:35 | FromDiscord | <alehander42> awesome |
19:47:44 | FromDiscord | <alehander42> have you seen the dts2nim thing |
19:47:50 | FromDiscord | <alehander42> we do need a newer one |
19:47:56 | FromDiscord | <alehander42> i wanted to write one, but totally no time |
19:47:58 | FromDiscord | <g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COB |
19:48:02 | FromDiscord | <alehander42> no |
19:48:07 | FromDiscord | <alehander42> this is rarely used |
19:48:12 | FromDiscord | <alehander42> because it generates a generic |
19:48:15 | FromDiscord | <g5becks> yea |
19:48:17 | FromDiscord | <g5becks> I see |
19:48:19 | FromDiscord | <alehander42> which is not always easy to work with |
19:48:33 | FromDiscord | <alehander42> i am not very good with typescript advanced |
19:48:34 | FromDiscord | <alehander42> types |
19:48:42 | FromDiscord | <alehander42> is this like an adt |
19:48:44 | FromDiscord | <g5becks> I need a way to reperesent typescript unions |
19:48:47 | FromDiscord | <alehander42> or like just an union |
19:49:01 | FromDiscord | <alehander42> e.g. can a concrete value be assigned this type |
19:49:03 | FromDiscord | <g5becks> Or else It just wont work |
19:49:18 | FromDiscord | <alehander42> well, maybe this is the correct mapping |
19:49:41 | FromDiscord | <alehander42> but .. i need to look at examples |
19:49:52 | FromDiscord | <alehander42> of functions like that |
19:50:06 | FromDiscord | <g5becks> It doesnt work |
19:50:40 | FromDiscord | <g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COC |
19:51:06 | FromDiscord | <g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COD |
19:51:25 | FromDiscord | <g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COE |
19:51:52 | FromDiscord | <g5becks> In typescript |
19:52:22 | FromDiscord | <alehander42> hmm |
19:52:25 | FromDiscord | <g5becks> I could assign a string or number or an object containing a name field anywhere the Anonymous type is used |
19:52:59 | FromDiscord | <g5becks> Without a way to represent Unions and anonymous objects. Theres a no way to map d.ts files to nim wrappers |
19:53:31 | disruptek | named tuples are essentially anonymous objects. |
19:53:34 | FromDiscord | <g5becks> Those two constructs are use literally everywhere in typescript |
19:53:41 | disruptek | not my problem. |
19:54:26 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2COF |
19:54:54 | disruptek | i'm surprised you can't make a typescript union work as a nim variant object, honestly. a little creativity would seem to go a long way here. |
19:55:03 | FromDiscord | <g5becks> @lqdev |
19:55:50 | disruptek | man, fuck decent internet. i'd settle for stable electricity. |
19:56:00 | FromDiscord | <g5becks> @disruptek |
19:56:13 | FromDiscord | <g5becks> It's literally like my 3rd day using nim |
19:56:19 | disruptek | i'm okay with that. |
19:56:21 | disruptek | ~manual |
19:56:22 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek |
19:56:22 | disbot | manual: 11just good to Ctrl+F in cases like this |
19:56:28 | disruptek | we have a seat for every ass. |
19:56:40 | FromDiscord | <g5becks> and a variant still doesnt map |
19:56:59 | FromDiscord | <g5becks> Because it has to have a name and a way to create it |
19:57:00 | disruptek | you have no idea how sad that makes me. |
19:57:10 | disruptek | a name? |
19:57:24 | FromDiscord | <g5becks> It's not anonymous |
19:57:57 | FromDiscord | <g5becks> It has to be defined beforehand |
19:58:04 | FromDiscord | <g5becks> this is valid typescript |
19:58:08 | disruptek | sounds super groovy, dude. |
19:58:19 | disruptek | does that manual link work for you? |
19:58:49 | FromGitter | <ynfle> @g5becks, why not tuples? |
19:59:05 | FromDiscord | <g5becks> @ynfle |
19:59:13 | FromDiscord | <g5becks> Tuples seemed like the answer |
19:59:30 | FromDiscord | <g5becks> Problem is that they don't compile to javascript objects |
20:00:00 | disruptek | you realize this is #nim, right? |
20:00:21 | FromDiscord | <g5becks> @disruptek |
20:00:28 | FromDiscord | <g5becks> Ok, and? |
20:00:28 | FromGitter | <ynfle> What do you mean "they don't compile"? |
20:01:09 | disruptek | and very few people here care about typescript and javascript. you are welcome to change the compiler and submit a PR. |
20:01:10 | FromDiscord | <ElegantBeef> I assume the issue is that tuples dont seemlessly interop with the JS objects |
20:01:31 | FromDiscord | <ElegantBeef> Dont get overly offended by disruptek, he's our 60 grit sandpaper |
20:01:48 | FromDiscord | <Rebel> he keeps it 💯 |
20:01:52 | FromDiscord | <g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COG |
20:02:15 | FromDiscord | <g5becks> @Rebel hes talking shit with nothing of value to offer |
20:02:26 | disruptek | don't use void as a return type. |
20:02:27 | FromDiscord | <g5becks> `` |
20:02:32 | disruptek | there's some fuckin' value for ya. |
20:02:36 | FromDiscord | <g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COH |
20:03:02 | FromDiscord | <ElegantBeef> Disruptek sometimes offers good advice 😄 |
20:03:24 | FromDiscord | <g5becks> Look |
20:03:33 | FromDiscord | <ElegantBeef> Cant you use a JsObject there and just check if it has a `name`? |
20:03:40 | FromDiscord | <g5becks> I am trying to create something I need and others may want to use |
20:03:50 | FromDiscord | <g5becks> @disruptek |
20:03:53 | FromGitter | <ynfle> You did named tuples. do something like tuple[cstring] |
20:04:03 | disruptek | you are welcome to ask. or, i will: |
20:04:12 | disruptek | who here is interested in typescript conversion to nim? |
20:04:21 | FromDiscord | <ElegantBeef> We already have dst2nim |
20:04:24 | FromDiscord | <ElegantBeef> or w/e it's called |
20:04:29 | FromDiscord | <Rebel> oh shit lol, you know discord has support for nim snippets you can do " three backticks nim \n code \n your ticks" |
20:04:39 | FromDiscord | <g5becks> @ElegantBeef |
20:04:50 | FromDiscord | <g5becks> it doest cover any real use cases |
20:04:58 | FromDiscord | <g5becks> typescript code is pretty complex |
20:05:04 | mipri | g5becks: ok, you do that and you get {Field0: 'gary'}. what output were you hoping for? |
20:05:07 | FromDiscord | <ElegantBeef> Yea i know i was talking to disruptek |
20:05:32 | FromDiscord | <g5becks> @ElegantBeef oh, ok |
20:06:20 | FromDiscord | <g5becks> No |
20:06:26 | FromDiscord | <alehander42> disruptek i am and i literally wanted to do that like many times |
20:06:46 | FromDiscord | <alehander42> and many people tired and overally convertion from dts to nim would be a very obvious good thing to have |
20:06:55 | disruptek | nah. it's a typical "i don't know anything about nim but i want you to sit here and teach me how to code my app." that's not the way this works. |
20:07:04 | FromDiscord | <alehander42> the edgy stuff doesn't work when you're wrong mate |
20:07:11 | disruptek | you start with some small amount of capital. |
20:07:19 | FromDiscord | <g5becks> @disruptek I asked a simple question |
20:07:23 | disruptek | you increase it by showing some investment. |
20:07:31 | FromDiscord | <alehander42> anyway 😄 |
20:07:34 | disruptek | we don't magically give a shit about your project because it exists. |
20:07:39 | mipri | no, what's going on is that g5becks is trying to do something precise, but hasn't explained it because he's responding to your dumb provocations |
20:07:46 | FromDiscord | <alehander42> disruptek just shut up for a second |
20:07:54 | disruptek | i already told him to fix the compiler. |
20:07:57 | FromDiscord | <g5becks> @disruptek |
20:08:07 | FromDiscord | <ElegantBeef> Will you shut up man? 😄 |
20:08:08 | FromDiscord | <alehander42> i love you and i want to buy you icecream |
20:08:16 | FromDiscord | <alehander42> but this address of yours keeps getting lost |
20:08:18 | FromDiscord | <alehander42> in the gc |
20:08:21 | FromDiscord | <alehander42> or something |
20:08:48 | disruptek | go ahead and tell me it doesn't need a compiler patch. |
20:08:50 | disruptek | i'll wait. |
20:08:51 | FromDiscord | <g5becks> I don't see how nim community can ever grow with people like this lingering in the community |
20:09:05 | FromDiscord | <ElegantBeef> Luckily disruptek isnt the entire community |
20:09:12 | FromDiscord | <alehander42> @g5becks so the problem is the union thing? |
20:09:14 | disruptek | we usually wash out the folks that aren't willing to invest any time in the language pretty quickly. |
20:09:15 | FromDiscord | <alehander42> or the cstring thing |
20:09:21 | FromDiscord | <ElegantBeef> you |
20:09:36 | FromDiscord | <alehander42> disruptek his original question was relevant, and it wasn't obvious even to me |
20:09:45 | disruptek | and my original answer still stands. |
20:10:08 | FromDiscord | <ElegantBeef> "rtfm div operator" |
20:10:11 | disruptek | i'm not the asshole because i don't take responsibility for nim not converting named tuples into javascript objects. jesus. |
20:10:15 | FromDiscord | <g5becks> @disruptek How am I not willing to invest time? |
20:10:19 | disruptek | no one cares. rtfm and fix the compiler. |
20:10:25 | disruptek | this is open source, buddy. |
20:10:34 | FromDiscord | <alehander42> dude it doesn't have anything to do with the compiler |
20:10:35 | FromDiscord | <g5becks> the fact that I answerd a question that you can even answer? |
20:10:46 | FromDiscord | <alehander42> like, it might but there are many solutions |
20:10:50 | mipri | g5becks, you're obviously willing to invest time into responding to disruptek, and commenting on his presence, when you're clearly getting no help from him. Just ignore him. |
20:10:51 | disruptek | it does have to do with the compiler. |
20:10:56 | FromDiscord | <alehander42> i used a `jsobject` macro for a long time |
20:11:04 | FromDiscord | <alehander42> with was enough for many cases |
20:11:07 | FromDiscord | <ElegantBeef> g5becks can you just say what you want to have to happen, what's happening? |
20:11:13 | FromDiscord | <alehander42> and i had an issue from years ago about the question |
20:11:14 | FromDiscord | <g5becks> Ok |
20:11:27 | * | mmohammadi9812 joined #nim |
20:11:43 | FromDiscord | <alehander42> @g5becks so basically one option is to use this macro |
20:12:00 | FromDiscord | <alehander42> which just generates an actual type of object each time with the correct fields |
20:12:15 | FromDiscord | <alehander42> but the js code should include the actual fields, not `Field1` etc |
20:12:25 | FromDiscord | <alehander42> for this a macro is enough |
20:12:44 | FromDiscord | <alehander42> if you really need local variables to somehow preserve this, then you need something more |
20:12:59 | FromDiscord | <alehander42> but for type defs only this doesn't seem to be |
20:13:01 | FromDiscord | <alehander42> relevant |
20:13:36 | FromDiscord | <alehander42> as one can easily refactor to a non-anonimoys type if needed to pass that and not directly deref .. |
20:14:47 | FromDiscord | <g5becks> exactly |
20:15:03 | FromDiscord | <alehander42> now, having an in-compiler support would be cool-er as disruptek rightly says |
20:15:08 | FromDiscord | <g5becks> I can actually get around the anonymous object problem |
20:15:08 | FromDiscord | <alehander42> but i had pushback for that |
20:15:10 | FromDiscord | <alehander42> in the past |
20:15:19 | FromDiscord | <alehander42> so that's why i am not so optimistic |
20:15:25 | FromDiscord | <g5becks> when traversing the typescript syntax tree |
20:15:56 | FromDiscord | <g5becks> I can create a nim type for the anonymous object that's needed |
20:16:16 | FromDiscord | <g5becks> but variant objects wont work as a replacement for union types |
20:16:34 | FromDiscord | <alehander42> https://github.com/nim-lang/Nim/issues/6623 |
20:16:34 | disbot | ➥ Feature request: a version of tuples that generates `.fieldname` |
20:16:40 | FromDiscord | <alehander42> this is the original issue IIR |
20:16:42 | FromDiscord | <alehander42> (edit) "IIR" => "IIRC" |
20:16:51 | FromDiscord | <alehander42> that's also possible |
20:17:03 | FromDiscord | <alehander42> and yeah variant types are adt replacement often |
20:17:23 | FromDiscord | <alehander42> you probably can try concepts or |
20:17:28 | FromDiscord | <alehander42> indeed nim's unions |
20:18:09 | disruptek | don't even bother with concepts. |
20:18:24 | * | narimiran quit (Ping timeout: 265 seconds) |
20:18:26 | FromDiscord | <alehander42> yeah, they're .. not stable |
20:18:36 | FromDiscord | <alehander42> but for an experimental project one might see what's up |
20:19:53 | FromDiscord | <g5becks> Ok |
20:19:59 | FromDiscord | <g5becks> I think I figured it out |
20:20:54 | FromDiscord | <alehander42> i want concepts man |
20:21:01 | FromDiscord | <alehander42> i hope they are done in 2021 |
20:23:00 | FromDiscord | <g5becks> @alehander42 |
20:23:08 | FromDiscord | <g5becks> So basically |
20:23:54 | FromDiscord | <g5becks> the union type needs to be used in the generic constraint position |
20:24:06 | FromDiscord | <g5becks> and not parameter position |
20:26:20 | FromDiscord | <alehander42> i really almost never use those |
20:26:24 | FromGitter | <ynfle> Exactly |
20:26:29 | FromDiscord | <alehander42> so even with several years of xp i am not sure about that |
20:26:34 | FromGitter | <ynfle> 👍 @ArRolin |
20:26:41 | FromDiscord | <alehander42> can you give an example of such a .dts file |
20:26:45 | FromDiscord | <alehander42> that you want to translare |
20:26:47 | FromDiscord | <alehander42> (edit) "translare" => "translate" |
20:27:18 | FromDiscord | <j$> can someone explain proc types |
20:27:19 | FromDiscord | <j$> https://play.nim-lang.org/#ix=2COP |
20:28:45 | FromDiscord | <g5becks> @alehander42 not at the moment |
20:29:09 | FromDiscord | <g5becks> actully |
20:29:31 | FromDiscord | <g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COS |
20:32:33 | mipri | j$, you're not setting the type of some_func there; you're providing the type of its return value |
20:32:42 | FromDiscord | <j$> ah |
20:32:43 | FromDiscord | <j$> yess |
20:32:49 | FromDiscord | <j$> silly me |
20:33:26 | FromDiscord | <g5becks> @alehander42 Thanks for the help. |
20:33:44 | FromDiscord | <j$> is there any way to do the thing I was trying? |
20:34:04 | mipri | just remove that return type from some_func and it works |
20:36:07 | FromDiscord | <j$> what about if the proc had params I'd have to specify those for the proc. I wanted to just specify the proc type |
20:36:49 | mipri | procs already have types, you don't need to specify them. |
20:37:02 | mipri | proc some_func = ... <-- it's a proc(). takes no arguments, returns none. |
20:37:46 | FromDiscord | <j$> okay so what about the situation with callbacks, I have to specify the params and return type instead of the proc type? |
20:37:56 | mipri | that is the proc type |
20:38:10 | mipri | proc() <- you've specified the params and the return type. there aren't any and there isn't one |
20:39:07 | mipri | https://play.nim-lang.org/#ix=2COX here's one with a slightly more interesting type |
20:39:48 | FromDiscord | <j$> yes, but I didn't want to re-specify the details of the proc for some_func |
20:40:06 | FromDiscord | <j$> so the type alias has some use |
20:41:32 | mipri | the use is in you not having to repeat those details for the 'p' argument to test_proc, or in other uses of the proc as a value |
20:41:53 | FromDiscord | <alehander42> @g5becks thanks. hm, so don't those |
20:42:01 | FromDiscord | <alehander42> implment an interface or somthing like that |
20:42:19 | FromDiscord | <alehander42> yeah for some of those |
20:42:27 | FromDiscord | <alehander42> just using jsobjects and casting |
20:42:30 | FromDiscord | <alehander42> might be easiest |
20:42:42 | FromDiscord | <alehander42> i mean, the jsffi ones which |
20:42:50 | FromDiscord | <alehander42> provide more dynamic escape hatch |
20:42:52 | mipri | maybe there's some weird JS-style thing you could do with const bindings and sugar lambdas, but if the problem is that you're having to define a bunch of similar procs, I'm sure a template could help with the specific task |
20:43:29 | FromDiscord | <j$> yeah, but in my case I'm using callbacks so it's just not very helpful to me, I have to look up the details and write them myself |
20:43:32 | FromDiscord | <j$> as for the js thing |
20:43:50 | FromDiscord | <j$> idk |
20:43:51 | mipri | in order to do anything in the proc you still need to know that stuff |
20:44:02 | Zevv | j$, what exactly are you trying to do? |
20:44:57 | mipri | j$ wants to define functions with a predefined proc type, rather than by having to name and give types for the proc's parameters and return value |
20:45:00 | FromDiscord | <j$> using glfw, I thought I could just use a type to specify the details of a proc for a callback |
20:45:35 | FromDiscord | <g5becks> @alehander42 The interfaces in typescript are all structurally typed |
20:45:56 | FromDiscord | <g5becks> So anything with the same shape can be used |
20:46:03 | Zevv | So it's basically about typing less? |
20:46:16 | FromDiscord | <g5becks> I would just used JsObject |
20:46:28 | FromDiscord | <g5becks> but then you loose typesafety |
20:46:55 | FromDiscord | <g5becks> an object can have 100s of keys |
20:46:56 | FromDiscord | <j$> that's seems like the same reason the proc types exist in the first place no? |
20:47:13 | Zevv | well, no, proc types are just 1st class types like any types. |
20:47:16 | mipri | they do not exist for the purpose of typing less when you're defining procs |
20:47:17 | Zevv | Is this helping maybe? https://nim-lang.github.io/Nim/manual.html#statements-and-expressions-using-statement |
20:49:43 | FromDiscord | <j$> well yeah they're types as well, but what else is specifying a proc type used for other than convenience? |
20:50:40 | mipri | you experience that convenience already in test_proc, where you just say ProcType for the parameter type. |
20:50:56 | mipri | the language doesn't need a shortcut for defining functions. It's not ATS. |
20:51:25 | mipri | if you've got a bunch of regular functions that all use the same types and parameter names, I bet a template could help you define those more conveniently. |
20:52:18 | Zevv | and if you want to go all the way, you can whip up a macro to do exacly what you need here, although that will take a bit more effort to setup |
20:54:12 | FromDiscord | <j$> really it wasn't that big a deal tbh, I just assumed I could use the defined proc type to specify the type of a proc I created. ↵with the example I provided, the only part I actually define with glfw is some_func, so in that case I haven't used any of the convenience. |
20:55:07 | FromDiscord | <j$> idk it just seems like I should be able to do that but I don't know enough about the lang soooo |
20:56:46 | mipri | how it works in ATS, a language with 300-character function signatures from all the extra guarantees you can shove in there, is that you define a type, and then you say `val f1: ftype`, `val f2: ftype`, you define a bunch of functions with that type, without providing implementations. and then later you say, 'implement f1(a, b) = ...` and go to town, only having to name the parameters because they're already typed, and not needing to provide the return type |
20:57:55 | mipri | the definition/implementation distinction also helps with header files. |
20:58:45 | mipri | but in Nim the closest thing to this is just declaring a function early for the sake of mutual recursion |
21:01:10 | mipri | but speaking of providing parameter names without their types, Nim has that |
21:01:43 | mipri | Zevv mentioned it above and I didn't even notice. https://nim-lang.org/docs/manual.html#statements-and-expressions-using-statement <- again |
21:02:33 | mipri | if you've got a bunch of repetitive functions, that plus a terse type for the return value might be all that you need |
21:05:06 | Zevv | no one ever notices :( |
21:09:02 | * | Kaivo quit (Ping timeout: 264 seconds) |
21:11:20 | * | Kaivo joined #nim |
21:15:57 | FromDiscord | <Avatarfighter> Zevv: i notice 🙂 |
21:16:57 | FromDiscord | <Avatarfighter> Random question but what is the advantage of using "method" over "proc" when doing OOP stuff with nim? |
21:18:14 | disruptek | it can slow down your program when it otherwise runs too fast. |
21:18:20 | mipri | dynamic vs. static dispatch |
21:19:17 | FromDiscord | <Avatarfighter> i guess a better question that I should be asking is wtf is static/dynamic dispatch? |
21:19:20 | * | Prestige quit (Quit: Prestige) |
21:19:39 | disruptek | varying proc invocation at runtime. |
21:20:02 | mipri | you have... let me think of a compelling OO example ... you have a list of fruit. if you map over it with a proc you'll just throw the fruit. But if you map over it with a method you can peel banasas, scare doctors with apples, and spit out watermelon seeds, without any nonsense about casts or checking what kind of fruit you have |
21:20:19 | FromDiscord | <Avatarfighter> Neveel |
21:20:33 | FromDiscord | <Avatarfighter> Had to google that lmao |
21:20:36 | FromDiscord | <Avatarfighter> yeah that makes sense |
21:20:43 | FromDiscord | <Avatarfighter> very cool that nim has it |
21:20:49 | * | Prestige joined #nim |
21:21:29 | * | NimBot joined #nim |
21:21:30 | FromDiscord | <Avatarfighter> Thank you mipri and disruptek |
21:21:53 | disruptek | is your bot done? |
21:22:29 | FromDiscord | <Avatarfighter> It is actually |
21:22:41 | disruptek | when's the release party? |
21:22:51 | FromDiscord | <Avatarfighter> im partying rn 🙂 |
21:23:14 | disruptek | w00t what's your winning percentage? |
21:23:33 | FromDiscord | <Avatarfighter> winning as it % of the sales i keep or the success rate? |
21:23:39 | disruptek | success. |
21:24:11 | FromDiscord | <Timmy> Is nim embeddable into a C++ program? Like Lua for example? |
21:24:13 | FromDiscord | <Avatarfighter> Last test i did i managed 20 success 5 fails but i think i can bring the fail chance down |
21:24:30 | FromDiscord | <Avatarfighter> @Timmy there is the nimvm which is embeddable |
21:25:04 | FromDiscord | <Avatarfighter> Raw nim can be used to ffi with c/cpp/objc/js though |
21:25:55 | FromDiscord | <nikki> @Timmy i use nim-generated c/c++ as part of the build in a cmake project |
21:26:04 | FromDiscord | <Timmy> I'm looking for something with code hotreloading. |
21:26:12 | FromDiscord | <Avatarfighter> Nimvm |
21:26:22 | FromDiscord | <ElegantBeef> Nim has hotcode reloading |
21:26:24 | FromDiscord | <Avatarfighter> @ElegantBeef is the resident vm nerd |
21:26:26 | FromDiscord | <ElegantBeef> compiled nim that is |
21:26:34 | disruptek | hahaha no. |
21:26:39 | FromDiscord | <Timmy> Could you link me that? @Avatarfighter |
21:27:20 | FromDiscord | <Avatarfighter> Disruptek: the main issue i have right now is with a company called datadome, they flag real users as bots and block access to the site so im trying to see if i can bypass that service entirely |
21:27:29 | FromDiscord | <Timmy> Nim itself can hot reload code? Where can I read more about that? |
21:27:38 | disruptek | google? |
21:28:16 | FromDiscord | <Timmy> When I google nimvm I get nim "version manager" |
21:28:22 | FromDiscord | <ElegantBeef> I've got <https://github.com/beef331/nimscripter> for easy interop |
21:28:25 | FromDiscord | <ElegantBeef> It's nimscript |
21:28:36 | FromDiscord | <ElegantBeef> easy interop with nimscript |
21:28:45 | FromDiscord | <nikki> searching "nim hot code reloading" gave me https://nim-lang.org/docs/hcr.html |
21:29:12 | FromDiscord | <Avatarfighter> https://nim-lang.org/docs/nims.html for docs on nimscript |
21:29:29 | FromDiscord | <Timmy> Thanks! reading now |
21:30:11 | mipri | supposedly https://github.com/inim-repl/INim uses hot code reloading. it loads https://nim-lang.org/docs/hotcodereloading.html after all |
21:31:19 | FromDiscord | <nikki> for my game engine scenario i'm thinking about doing this by actually just serializing game state and then reloading the app. it's tricky when types change etc.; and leveraging the existing eg. serialization migration logic for it makes sense |
21:31:38 | FromDiscord | <nikki> (edit) "for my game engine scenario i'm thinking about doing this by actually just serializing game state ... and" added "/ ui state (eg. what stuff you have selected in the editor)" |
21:32:42 | FromDiscord | <nikki> i dug pretty far into a code-reloading base UX for dev and -- it's nice for scoped changes of eg. constants for the jump distance of an object and so on, but then with larger changes you can often get into states of your program that are only possible due when reloading multiple times and you'd never actually get to on a fresh run xD |
21:33:42 | PMunch | Back :) |
21:35:30 | Prestige | o/ |
21:35:37 | Prestige | more streaming today PMunch ? |
21:35:48 | PMunch | Unfortunately not, it's getting late here |
21:36:39 | * | lritter quit (Ping timeout: 260 seconds) |
21:40:25 | reversem3 | Any playing with prologue for web development ? |
21:40:48 | reversem3 | * Anyone playing with prologue for web development ? |
21:41:50 | FromDiscord | <Theodore> Ayo would Nim be good for parsing bencode? |
21:42:13 | FromDiscord | <Theodore> why r these irc yutes here |
21:42:36 | Prestige | sure @Theodore |
21:45:06 | PMunch | @Theodore, got anything against IRC? |
21:58:28 | * | eburk joined #nim |
22:02:46 | * | mmohammadi9812 quit (Quit: Quit) |
22:03:11 | * | mmohammadi9812 joined #nim |
22:03:34 | Yardanico | @Theodore there is already at least two nim bencode libs |
22:03:39 | Yardanico | !repo bencode |
22:03:40 | disbot | https://github.com/xmonader/nim-bencode -- 9nim-bencode: 11bencode encoder/decoder in nim 15 3⭐ 1🍴 7& 3 more... |
22:03:45 | Yardanico | !rip bencode 3 |
22:03:49 | Yardanico | !repo bencode 3 |
22:03:51 | disbot | https://github.com/fuzeman/bencode.py -- 9bencode.py: 11Simple bencode parser (for Python 2, Python 3 and PyPy) 15 19⭐ 10🍴 7& 20 more... |
22:03:53 | Yardanico | it doesn't work like that? |
22:03:59 | Yardanico | !repos bencode |
22:04:00 | disbot | https://github.com/xmonader/nim-bencode -- 9nim-bencode: 11bencode encoder/decoder in nim 15 3⭐ 1🍴 |
22:04:00 | disbot | https://github.com/FedericoCeratto/nim-bencode -- 9nim-bencode: 11Bencode library for Nim 15 2⭐ 0🍴 |
22:04:00 | disbot | https://github.com/rokups/nim-bencode -- 9nim-bencode: 11BEncoding encoding/decoding lib for Nim language 15 1⭐ 0🍴 7& 1 more... |
22:04:01 | Yardanico | ohhh |
22:04:03 | Yardanico | yes this |
22:05:07 | FromDiscord | <dom96> @haxscramper you should ask narimiran, or better yet make an issue somewhere about it. Maybe the Nim website repo or even RFCs 🙂 |
22:34:58 | reversem3 | Ok , I still haven't figure this one out yet , why do I get an error from nimsuggest using nvim "nimsuggest is only available to file on disk". I am trying to just create a new file |
22:37:36 | PMunch | What on earth.. |
22:37:54 | PMunch | Trying to debug a problem with dbus |
22:38:48 | FromDiscord | <nikki> reversem3 -- i also would kinda run into this through nimlsp. worked around it by always using `touch path/to/the_new_file.nim` and then just opening that created file in vim instead of having vim create a new file |
22:38:52 | PMunch | And I added a `echo "Checking ", $cast[int](watch)` to a loop over self.watches |
22:39:08 | PMunch | And it shows me that one of the pointers in "16" |
22:39:12 | FromDiscord | <nikki> i think it's bc. the new file isn't written yet when you first open it; and nimsuggest gets confused trying to find it |
22:39:35 | PMunch | But if I add `echo self.watches.mapIt(cast[int](it))` before the loop it doesn't show it, and the error is gone.. |
22:39:44 | reversem3 | Ahh that makes sense , I like to vim as a filemanager and IDE so thats a bummer |
22:39:49 | reversem3 | thanks |
22:40:56 | reversem3 | Thats so weird , I did a touch app.nim even though I already created it and nimsuggest works great now |
22:41:00 | reversem3 | Thanks again |
22:42:09 | PMunch | The thick plottens |
22:42:31 | PMunch | I echo self.watches.len and it gives be 121, even though there are only two values in the sequence.. |
22:43:45 | FromDiscord | <Clyybber> PMunch: Sounds like memory corruption |
22:43:52 | * | solitudesf quit (Ping timeout: 260 seconds) |
22:44:17 | PMunch | Well, the values are always those |
22:44:30 | PMunch | 121 for the length, and one of the pointers is 16 |
22:44:57 | FromDiscord | <Clyybber> hmm |
22:45:49 | FromDiscord | <Clyybber> does a tiny sleep instead of an echo also fix the issue? |
22:46:02 | FromDiscord | <Clyybber> before the loop I mean |
22:46:48 | PMunch | Nope |
22:55:41 | PMunch | This is a strange error indeed.. |
22:56:22 | PMunch | Oh well, I should've gone to bed ages ago |
22:56:25 | PMunch | Good night |
22:56:43 | * | PMunch quit (Quit: leaving) |
22:58:00 | * | tane quit (Quit: Leaving) |
22:58:07 | FromDiscord | <Clyybber> good night |
23:02:22 | reversem3 | choosenim/toolchains/nim-1.4.0/lib/core/rlocks.nim(14, 10) Error: Rlocks requires --threads:on option. |
23:06:32 | Yardanico | --threads:on |
23:06:36 | Yardanico | :P |
23:15:10 | FromDiscord | <UNIcodeX> looking at documentation for `strscans`, `scanf` doesn't seem to have a selector to return a single character. Is that right? |
23:39:09 | * | mbomba quit (Ping timeout: 260 seconds) |
23:51:11 | FromDiscord | <Yardanico> it does though |
23:51:29 | FromDiscord | <Yardanico> ah you want only 1 char in the middle of the string? |
23:51:42 | FromDiscord | <Yardanico> if you have something to match after that char, you can match it easily |
23:52:01 | FromDiscord | <Yardanico> but I don't think there's a default matcher for matching a single char at the end of the string or something like that |
23:52:03 | FromDiscord | <Yardanico> you can make your own |