00:26:14 | FromDiscord | <juan_carlos> How can I assert that a nnkIdent is a mutable var ?. |
00:30:52 | FromDiscord | <ElegantBeef> You cannot since idents dont carry anything |
00:31:01 | FromDiscord | <ElegantBeef> You'd have to bind the sym or get it typed |
00:31:54 | FromDiscord | <juan_carlos> Yep, I remember now, thanks. |
00:55:04 | * | cyraxjoe joined #nim |
01:29:23 | fn | <ForumUpdaterBot99> New thread by Stu002: Associating a constant with a concept?, see https://forum.nim-lang.org/t/8187 |
01:51:33 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3rMP |
01:58:12 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3rMQ |
01:58:48 | FromDiscord | <ElegantBeef> Though without a test cannot confirm if that works for you |
02:05:05 | FromDiscord | <ElegantBeef> @hamidb80 did that work? |
02:05:23 | FromDiscord | <ElegantBeef> If not give me a usable example i'm too lazy to make one for you π |
02:08:34 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3rMS |
02:09:17 | FromDiscord | <hamidb80> i dont know why mapIt filterIt, ... just works with pars () |
02:10:00 | FromDiscord | <hamidb80> In reply to @hamidb80 "why do i have": even if you want pass a block of code to it, you should pass it with pars () |
02:10:11 | FromDiscord | <hamidb80> (edit) "it," => "them," |
02:10:23 | FromDiscord | <ElegantBeef> Ah i see |
02:10:39 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3rMU |
02:11:24 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual_experimental.html#do-notation |
02:12:24 | FromDiscord | <hamidb80> "do with parentheses is an anonymous proc; however a do without parentheses is just a block of code." |
02:12:38 | FromDiscord | <hamidb80> Haha, i didn't know that, thank u |
02:13:45 | FromDiscord | <ElegantBeef> Now the reason why it needs the pars is probably just due to how the evaluation works but idk |
02:16:35 | FromDiscord | <hamidb80> yeah i think `do` notation distinguishes a untyped parameter for a macro to a block of code |
02:21:36 | FromDiscord | <ElegantBeef> Yea the block there just doesnt work there, the parse just doesnt like it π |
02:29:00 | * | cyraxjoe quit (Quit: I'm out!) |
02:46:18 | * | arkurious quit (Quit: Leaving) |
02:51:58 | * | rockcavera quit (Remote host closed the connection) |
02:55:22 | FromDiscord | <@bracketmaster-5a708063d73408ce4> do macros make nim homoiconic? |
02:56:38 | FromDiscord | <ElegantBeef> Well they're homoiconic macros |
03:06:04 | FromDiscord | <Rika> what would disqualify a language from being homoiconic |
03:09:56 | FromDiscord | <Rika> p.sure you can wrap a whole nim file in a macro and it would work so i guess? |
03:13:42 | * | cyraxjoe joined #nim |
03:23:10 | FromDiscord | <RattleyCooper> I'm pretty new to nim and I'm wondering if there is a concrete type like a `seq` that can contain a variety of types? |
03:24:01 | FromDiscord | <RattleyCooper> types would be arbitrary and inconsistent |
03:24:01 | FromDiscord | <Rika> no, you have to box the variety |
03:24:14 | FromDiscord | <Rika> totally arbitrary is impossible without type elision |
03:24:22 | FromDiscord | <Rika> ...i believe |
03:25:23 | FromDiscord | <Rika> if you know the subset of types you want to store you can use the boxing (variant type) method |
03:26:11 | FromDiscord | <Rika> otherwise i dont know of more methods but storing it in a `pointer` (equiv. C void) |
03:27:04 | FromDiscord | <Rika> are you sure the types are totally arbitrary? |
03:27:53 | FromDiscord | <RattleyCooper> Yes |
03:28:55 | FromDiscord | <Rika> what are you aiming to do? |
03:28:56 | FromDiscord | <RattleyCooper> I mean, I suppose. I was just thinking about how RPC works and was wondering how someone would create a way to register RPC procedures |
03:29:28 | FromDiscord | <RattleyCooper> And so if someone wanted to create a RPC how would you deal with the variety of types they might be using in their procedure calls? |
03:29:41 | FromDiscord | <Rika> register RPC procedures? you cant exactly make procedures anyway so it is done in macro i believe? |
03:29:42 | FromDiscord | <RattleyCooper> I'm not actually doing this, it's more of an exercise |
03:29:58 | FromDiscord | <Rika> so youre trying to implement closures |
03:29:59 | FromDiscord | <Rika> ? |
03:30:39 | FromDiscord | <Rika> i dont understand the relation of storing types in a heterogeneous seq and RPC |
03:30:53 | FromDiscord | <RattleyCooper> Well more of a dispatcher. Register RPCs to some kind of container and then send/receive the RPC info over network and run the RPC and send the result back |
03:31:29 | FromDiscord | <Rika> huh? |
03:31:37 | FromDiscord | <Rika> container as in docker? |
03:31:37 | FromDiscord | <RattleyCooper> remote procedure call |
03:31:39 | FromDiscord | <RattleyCooper> over the network |
03:31:42 | FromDiscord | <Rika> i know what RPC means |
03:31:49 | FromDiscord | <Rika> but how are you implementing that exactly |
03:32:03 | FromDiscord | <RattleyCooper> So the user defines their procedures and labels them as a RPC |
03:32:12 | FromDiscord | <ElegantBeef> Basically by doing it completely wrong |
03:32:17 | FromDiscord | <Rika> so you want an evaluation system as well? |
03:32:21 | FromDiscord | <ElegantBeef> You dont need to capture any variables yourself |
03:32:23 | FromDiscord | <Rika> that doesnt sound like rpc |
03:32:32 | FromDiscord | <Rika> that just sounds like a remote repl |
03:32:45 | FromDiscord | <ElegantBeef> Well anyway a p2p "rpc" can be seen here https://github.com/beef331/nettyrpc |
03:32:46 | FromDiscord | <Rika> im honestly absolutely confused |
03:32:47 | fn | <R2D299> itHub: 7"Implements an RPC like system using netty." |
03:33:19 | FromDiscord | <ElegantBeef> It captures the to/from inside of a lambda |
03:33:38 | FromDiscord | <Rika> you handle this beef ive stuff to do right now lol |
03:33:40 | FromDiscord | <ElegantBeef> Actually iirc it adds the `from` into the procedure |
03:33:49 | FromDiscord | <ElegantBeef> Will do π |
03:33:56 | FromDiscord | <RattleyCooper> So, I'm not so much worried about making my own RPC... |
03:34:34 | FromDiscord | <ElegantBeef> Well you're worried about holding heterogeneous types together which requires boxing |
03:35:13 | FromDiscord | <Rika> boxing in either variant types (known subset) or total type erasure (unknown subset) |
03:35:14 | FromDiscord | <ElegantBeef> I have this library that aids in that but it's not overly great https://github.com/beef331/nettyrpc |
03:35:16 | fn | <R2D299> itHub: 7"Implements an RPC like system using netty." |
03:35:22 | FromDiscord | <Rika> you sent that already |
03:35:25 | FromDiscord | <ElegantBeef> god damn it |
03:35:27 | FromDiscord | <Rika> lol |
03:35:30 | FromDiscord | <ElegantBeef> https://github.com/beef331/sumtypes |
03:35:32 | fn | <R2D299> itHub: 7"Easy to use Nim sum type library" |
03:35:32 | FromDiscord | <ElegantBeef> There we go |
03:36:21 | FromDiscord | <Rika> @ElegantBeef the issue is he does not know the types |
03:36:26 | FromDiscord | <Rika> so thats not feasible |
03:37:12 | FromDiscord | <ElegantBeef> Let's look at this rpc example, you're wanting to hold a bunch of procedures in a list right? |
03:37:58 | FromDiscord | <RattleyCooper> Yeah, I have a template that can handle most of it |
03:38:01 | FromDiscord | <ElegantBeef> got a bit of a headache so probably going to be loopy π |
03:38:08 | FromDiscord | <Rika> when are you not |
03:38:16 | FromDiscord | <ElegantBeef> No clue |
03:38:24 | FromDiscord | <RattleyCooper> I'm just struggling with a container with varying types on my custom type |
03:38:40 | FromDiscord | <RattleyCooper> Can I paste small snippets in here? |
03:38:47 | FromDiscord | <ElegantBeef> Yep or on the playground |
03:38:49 | FromDiscord | <Rika> sure y noty |
03:38:52 | FromDiscord | <Rika> (edit) "noty" => "not" |
03:39:15 | FromDiscord | <RattleyCooper> sent a long message, see http://ix.io/3rN7 |
03:39:26 | FromDiscord | <RattleyCooper> I put `rpc_args` as `int` so it will compile |
03:39:44 | FromDiscord | <RattleyCooper> I am not going to register the varargs |
03:39:58 | FromDiscord | <RattleyCooper> Just showing what I want for my `rpc_args` |
03:40:03 | FromDiscord | <ElegantBeef> Yea this just seems like the wrong way about |
03:40:04 | FromDiscord | <RattleyCooper> something like `varargs` |
03:40:09 | FromDiscord | <RattleyCooper> How should I do it? |
03:40:26 | FromDiscord | <Rika> uh no |
03:40:30 | FromDiscord | <Rika> you cannot |
03:40:31 | FromDiscord | <RattleyCooper> I'm coming from much looser languages lol |
03:40:37 | FromDiscord | <ElegantBeef> Well you can rika |
03:40:41 | FromDiscord | <RattleyCooper> Well I don't know any better |
03:40:47 | FromDiscord | <ElegantBeef> Yea it's fine what you attempted |
03:40:48 | FromDiscord | <Rika> put it in a `pointer` and figure out how to make the proc accept it |
03:40:52 | FromDiscord | <ElegantBeef> Nah |
03:40:57 | FromDiscord | <Rika> wdym then |
03:41:03 | FromDiscord | <Rika> wait |
03:41:05 | FromDiscord | <ElegantBeef> Let's use nettyrpc as an example |
03:41:05 | FromDiscord | <Rika> varargs |
03:41:15 | FromDiscord | <Rika> that means its still homogeneous isnt it |
03:41:43 | FromDiscord | <ElegantBeef> I assume you want all your args to be anything? |
03:41:47 | FromDiscord | <RattleyCooper> Yeah |
03:41:57 | FromDiscord | <ElegantBeef> Then yea you can make an inbetween lambda |
03:42:00 | FromDiscord | <ElegantBeef> Like i do with netty |
03:42:01 | FromDiscord | <ElegantBeef> (edit) "netty" => "nettyrpc" |
03:42:03 | FromDiscord | <Rika> the only method i know is what lua's c integration does or so i believe |
03:42:04 | FromDiscord | <ElegantBeef> Will show an example |
03:42:08 | FromDiscord | <RattleyCooper> π |
03:44:20 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3rN8 |
03:44:34 | FromDiscord | <ElegantBeef> that event table is an `array[id, proc(s: var Stream)` |
03:44:43 | FromDiscord | <Rika> oh you're making it a stream |
03:44:54 | FromDiscord | <Rika> so basically kinda what i was thinking of as well |
03:45:09 | FromDiscord | <Rika> a proc that receives a pointer and handles the parameters itself |
03:45:13 | FromDiscord | <ElegantBeef> Well it's the best way to do it, have each procedure read the stream |
03:45:21 | FromDiscord | <Rika> just more nim like, i think in c i guess |
03:45:23 | FromDiscord | <ElegantBeef> Yea that'd work aswell ofc but isnt as nice |
03:45:46 | FromDiscord | <ElegantBeef> (edit) "https://play.nim-lang.org/#ix=3rN8" => "https://play.nim-lang.org/#ix=3rN9" |
03:45:48 | FromDiscord | <RattleyCooper> I will have to look into streams |
03:45:58 | FromDiscord | <ElegantBeef> Well look at nettrpc it's not a large library, though uses macros |
03:46:11 | FromDiscord | <ElegantBeef> the main module is 100 loc |
03:46:26 | FromDiscord | <RattleyCooper> I read up on the AST and a little bit on macros, but to be honest most of my programming experience is in python and PHP |
03:46:30 | FromDiscord | <RattleyCooper> and gdscript lol |
03:47:29 | FromDiscord | <ElegantBeef> Well the beauty is you can rip the entire macro apart putting in `treeRepr` or compile with `--expandMacro:networked` |
03:47:29 | FromDiscord | <RattleyCooper> So I have a lot to learn. A lot of stuff goes over my head but I am trying lol |
03:47:43 | FromDiscord | <RattleyCooper> Oh wow |
03:48:04 | FromDiscord | <ElegantBeef> `treeRepr(someNode)` will output the ast |
03:49:21 | FromDiscord | <ElegantBeef> and `--expandMacro:networked` will show you the generated AST of that macro, so you can see what i do and understand it hands on |
03:49:34 | FromDiscord | <ElegantBeef> I do have two examples that work |
03:49:59 | FromDiscord | <ElegantBeef> I guess it's generated code, not AST, but meh |
03:50:07 | FromDiscord | <RattleyCooper> lol |
03:50:35 | FromDiscord | <ElegantBeef> I'm also almost always here if you need to talk about what i do |
03:52:04 | FromDiscord | <RattleyCooper> Thanks! I am still trying to figure this out. I haven't gotten this far out of my comfort zone in a while lol |
03:52:45 | FromDiscord | <RattleyCooper> I am just trying to figure out all the different types and how templates/proc/func work |
03:53:32 | FromDiscord | <Bung> pmunch's jsonschema dont do export types ? |
03:53:41 | FromDiscord | <ElegantBeef> `func` is just a `proc` |
03:53:48 | FromDiscord | <ElegantBeef> `templates` are code subsitution |
03:54:12 | FromDiscord | <ElegantBeef> Though a `func` cannot have side effects so anything that mutates variables not passed in as `var` |
03:54:25 | FromDiscord | <RattleyCooper> Yeah, I am just not used to compiled languages so I don't understand why you can't have something like `varargs` outside of a template |
03:54:34 | FromDiscord | <ElegantBeef> You can though |
03:54:43 | FromDiscord | <RattleyCooper> Oh? |
03:54:46 | FromDiscord | <ElegantBeef> `proc a(args: varargs[int])` works |
03:54:55 | FromDiscord | <RattleyCooper> Oh sorry, `untyped` |
03:55:15 | FromDiscord | <RattleyCooper> `proc a(args: varargs[untyped])` doesn't work does it? |
03:55:21 | FromDiscord | <ElegantBeef> No cause it's not semantically checked |
03:55:33 | FromDiscord | <RattleyCooper> Yeah, this is the stuff I'm missing haha |
03:55:34 | FromDiscord | <Bung> you should use template |
03:55:54 | FromDiscord | <RattleyCooper> Been reading but there is so much. Just going to take precious time |
03:56:48 | FromDiscord | <ElegantBeef> Well we're here so can always ask π |
03:58:24 | FromDiscord | <RattleyCooper> I appreciate it! I'm sure I'll have more questions. I'm looking through `nettyrpc` right now |
03:58:33 | FromDiscord | <Bung> @PMunch jsonschema dont do export types ? |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:37 | * | supakeen joined #nim |
04:32:35 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3rNg |
04:33:11 | FromDiscord | <reilly> (edit) "https://play.nim-lang.org/#ix=3rNg" => "https://play.nim-lang.org/#ix=3rNh" |
04:33:19 | FromDiscord | <reilly> (edit) "https://play.nim-lang.org/#ix=3rNh" => "https://play.nim-lang.org/#ix=3rNi" |
04:34:30 | FromDiscord | <reilly> If not, I could always just walk the directory at runtime... but that seems so much slower. |
04:35:46 | FromDiscord | <ElegantBeef> look at `walkdir` and `static` |
04:37:52 | FromDiscord | <ElegantBeef> sent a code paste, see https://paste.rs/mAN |
04:38:00 | FromDiscord | <ElegantBeef> May need to use a macro to make it an array |
04:51:10 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3rNl |
04:52:00 | FromDiscord | <reilly> This isn't super flexible, since it assumes that there will always be 635 files in the directory, but it works for now. |
04:59:05 | FromDiscord | <ElegantBeef> It takes like 2 seconds to make the macro π |
05:01:01 | FromDiscord | <reilly> Bold of you to assume I have the slightest understanding of macros. |
05:03:51 | FromDiscord | <ElegantBeef> I'll get it to you in a minute π |
05:10:15 | FromDiscord | <ElegantBeef> @reilly https://play.nim-lang.org/#ix=3rNt here? |
05:12:30 | FromDiscord | <ElegantBeef> Now all you need to do is make a seq then pass it to that macro and boom |
05:16:56 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3rNu |
05:17:17 | FromDiscord | <ElegantBeef> just do the logic in a `nodeNames = static:` π |
05:20:30 | FromDiscord | <reilly> I don't really understand how to use `static:`. |
05:21:09 | FromDiscord | <reilly> The manual isn't much help in that regard. (Wow, compile-time `echo`s! ...and only compile-time `echo`s.) |
05:21:23 | FromDiscord | <ElegantBeef> well it runs code at compile time |
05:21:32 | FromDiscord | <ElegantBeef> So if you put getNodenames in there hten call `asArray it'll be fine |
05:23:41 | FromDiscord | <ElegantBeef> Unless you want that procedure to be cleaner π |
05:28:21 | FromDiscord | <reilly> I'm having a hard time putting into words why that doesn't make sense to me. You already have everything I've written, and you obviously know better than I do, so could you just show me? |
05:28:46 | FromDiscord | <reilly> It'll click when I actually see it, I'm sure. |
05:31:18 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=3rNy |
05:35:11 | FromDiscord | <reilly> That doesn't work. `res` gets filled just fine, but `asArray` spits out an `array[0..-1, empty]`, which is obviously not correct. |
05:35:50 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I've heard that nim can automatically insert free calls during compilation when the compiler is able to determine an object goes out of scope |
05:35:57 | FromDiscord | <@bracketmaster-5a708063d73408ce4> what is this behavior called? |
05:38:16 | FromDiscord | <RattleyCooper> https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html |
05:38:25 | FromDiscord | <RattleyCooper> ^ this? |
05:38:59 | FromDiscord | <RattleyCooper> scope based memory management? |
05:43:15 | FromDiscord | <ElegantBeef> @reilly works fine it was cause it was an empty array |
05:43:21 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=3rNz |
05:44:25 | FromDiscord | <reilly> I had tested it on my actual machine, not on the site, so the array should have been anything but empty. Well, now we have an "it works on my machine" problem. |
05:45:35 | FromDiscord | <ElegantBeef> Ah nvm the adding is different |
05:45:40 | FromDiscord | <ElegantBeef> So disregard jusut use the proc π |
05:46:36 | FromDiscord | <reilly> You know what they say, if it ain't broke, don't fix it. |
05:55:28 | FromDiscord | <Rika> "witchcraft" |
05:55:31 | FromDiscord | <Rika> not really... |
06:35:09 | * | max22- joined #nim |
06:41:53 | * | max22- quit (Ping timeout: 268 seconds) |
07:07:57 | fn | <ForumUpdaterBot99> New thread by Arnetheduck: Safe `enum` conversion, see https://forum.nim-lang.org/t/8188 |
07:23:44 | * | max22- joined #nim |
07:24:57 | * | beshr joined #nim |
07:33:11 | FromDiscord | <ElegantBeef> I cant way to see arne's negative feedback for my response on that post! π |
07:33:41 | FromDiscord | <Rika> Cursed macro |
07:34:02 | FromDiscord | <ElegantBeef> I think timothee one lined it |
07:34:05 | FromDiscord | <ElegantBeef> I dont recall |
07:34:47 | FromDiscord | <ElegantBeef> Or maybe i did it, cause i regret the `result =` there |
07:35:05 | FromDiscord | <Rika> Well IMO itβs a bad solution because does everyone now need to copy that macro and proc |
07:35:15 | FromDiscord | <ElegantBeef> Well no cause you put it in a module π |
07:35:20 | FromDiscord | <ElegantBeef> It's also the safest way |
07:35:45 | FromDiscord | <Rika> In reply to @ElegantBeef "Well no cause you": Still a lot of duplication across programmers |
07:36:09 | FromDiscord | <ElegantBeef> Well this is arne so probably status, and they run their own stdlib |
07:37:09 | FromDiscord | <ElegantBeef> It probably needs to be included somewhere considering the complexity i agree though |
07:37:27 | FromDiscord | <ElegantBeef> But it's the only way to safely generate a range for the holey enums |
07:38:14 | FromDiscord | <Rika> Praying to one of my enums right now |
07:38:31 | FromDiscord | <ElegantBeef> hey i said holey not holy |
07:50:00 | FromDiscord | <Rika> βI realize now this is probably too much for your style guide :Dβ lol |
07:51:00 | FromDiscord | <ElegantBeef> Well it's the only safe way i can see to do it, so who wants to PR into `enumutils`? π |
07:51:15 | FromDiscord | <Rika> Why donβt you |
07:51:48 | FromDiscord | <ElegantBeef> smokebomb |
08:02:40 | * | xet7 joined #nim |
08:33:21 | FromDiscord | <haxscramper> In reply to @Ayy Lmao "That would be very": https://github.com/haxscramper/hnimast/blob/master/tests/tCompilerAux.nim#L15 |
08:33:44 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3rO1 |
08:34:08 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3rO2 |
08:34:18 | FromDiscord | <haxscramper> It does work, but it is not pretty by any means |
08:34:47 | FromDiscord | <haxscramper> You can implement own mangling scheme to have something adequate, right now I just convert `nkSym` to sighash directly |
08:35:40 | FromDiscord | <haxscramper> NIm compiler also generates intermediate variables like `_T90` to guarantee order of argument evaluation |
08:35:53 | FromDiscord | <haxscramper> IIRC C does not enforce it, maybe lua does, so it is not necessaary |
08:36:13 | FromDiscord | <haxscramper> But lua does not have support for `if` expressions etc. |
08:36:39 | FromDiscord | <haxscramper> You don't need to worry about macros and templates, they are handled by `compilestring` |
08:36:50 | FromDiscord | <haxscramper> I also added `symDefines` to pass `define` flags to compilation |
08:37:07 | FromDiscord | <haxscramper> Pushed new version - `0.3.31` for hnimast, it has these changes |
08:38:09 | FromDiscord | <haxscramper> Right now I just generate string with almost no control over indentation etc. You can use https://haxscramper.github.io/hmisc/src/hmisc/other/blockfmt.html to make it better-looking |
08:41:41 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3rO4 |
08:43:25 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3rO5 |
08:44:35 | FromDiscord | <haxscramper> For some things - IDK how I'm supposed to handle them exactly. Like `nkHiddenDeref` https://github.com/haxscramper/hnimast/blob/ece4676973258330e323fefe15ea81f39ab2ed18/tests/tCompilerAux.nim#L64 etc. |
08:45:07 | FromDiscord | <haxscramper> Not sure what they are responsible for on the nim side and I don't know enough lua to correctly convert them |
09:56:12 | FromDiscord | <haxscramper> In reply to @haxscramper "It does work, but": https://github.com/nim-lang/Nim/pull/14632/files had more readable manging scheme implemented |
11:05:13 | * | max22- quit (Ping timeout: 246 seconds) |
11:14:41 | FromDiscord | <gerwy> Hi so i was wondering |
11:14:46 | FromDiscord | <gerwy> because basically i have a list of some youtubers i like to watch when i am bored and i loop through all of them to see if some new video appeared, but i don't always remember all of them so i would like to automate this thing |
11:14:54 | FromDiscord | <gerwy> do anyone know any resource for that? Like Youtube API or or something like ths? |
11:14:59 | FromDiscord | <gerwy> (edit) "ths?" => "this?" |
11:16:15 | FromDiscord | <gerwy> its probably possible to do it in python easily, but i wonder if i could do something like this in nim too, but idk how to work with API's in nim or if there is a way for me to check videos of youtuber from outside of youtube without going full page fetch path |
11:18:56 | FromDiscord | <gerwy> TLDRβ΅How to use API's with Nim |
11:19:36 | FromDiscord | <gerwy> (edit) "TLDRβ΅How" => "TL;DRβ΅How" |
11:20:56 | FromDiscord | <Kermithos> I think youtube has an RSS feed |
11:21:05 | FromDiscord | <Kermithos> would probably be the easiest way |
11:22:00 | FromDiscord | <Rika> wouldnt be surprised if they removed it sooner or later though |
11:22:46 | FromDiscord | <Kermithos> yea, there are still other ways but Im not sure how they work |
11:23:07 | FromDiscord | <Kermithos> but projects like FreeTube, newpipe or Inviodious can get the feed without the rss endpoint |
11:23:39 | FromDiscord | <gerwy> In reply to @Kermithos "I think youtube has": it has, i should probably even use it because i heard that if you fetch big amount of channels videos then you can get banned (im using FreeTube) |
11:24:38 | FromDiscord | <gerwy> but yeah, i don't need it to be seconds or minutes precise, i just want to know if new video is out so yeah, hmm could be usefulβ΅hmmm, RSS Feed is just XML? Right? or HTML? |
11:24:45 | FromDiscord | <Kermithos> not sure what ratelimits youtube has for RSS but if you dont spam it should be fine |
11:25:03 | FromDiscord | <Kermithos> In reply to @Life Sucks "but yeah, i don't": xml |
11:25:16 | FromDiscord | <gerwy> i have more than 200 subscribers, probably less than 100 is the limit |
11:25:56 | FromDiscord | <gerwy> oh okay and i saw that nim has xml parser in std, nice i could now receive it, store it and look for changes right? |
11:26:53 | FromDiscord | <Kermithos> yea |
11:27:01 | FromDiscord | <Kermithos> you could check the upload date too |
11:27:58 | FromDiscord | <gerwy> Okay thanks i forgot about the RSS feedβ΅i will make something with it, after that i would like to make it so that i type command into the terminal instead of typing to execute the script |
11:28:14 | FromDiscord | <gerwy> but i guess it could be just an alias so yeah hmm doesn't seem as hard as i thought thaaanks<3 |
11:28:42 | FromDiscord | <Kermithos> In reply to @Life Sucks "but i guess it": if you are on linux you can just write it in your ~/.bashrc |
11:29:11 | FromDiscord | <gerwy> well im basically on linux kinda |
11:29:30 | FromDiscord | <gerwy> and im using zsh, soo, yeah in ~/.zshrc |
11:29:40 | FromDiscord | <Rika> i'd love to make a program for my sub feed too, but i unfortunately want precise timing and also have almost 1000 subscriptions so i dont think i can... |
11:31:42 | FromDiscord | <gerwy> i hate it that youtube now doesn't show precise sub count, |
11:32:56 | FromDiscord | <gerwy> but if you log into YT and use it's API i think its possible, you can do (or even use if he shared the code) carykh sub counter, but change some things because he fetches sub count like every second or every minute and just lerp to the next value he got |
11:34:31 | FromDiscord | <gerwy> hmm something like this |
11:34:31 | FromDiscord | <gerwy> https://www.youtube.com/watch?v=JNBsdSsAmYQ |
11:34:34 | fn | <R2D299> outube: 7"JACKNJELLIFY HITTING ONE MILLION STREAM!" |
11:36:04 | FromDiscord | <gerwy> can't find code for it tho :// |
11:37:45 | * | max22- joined #nim |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:36 | * | supakeen joined #nim |
12:30:00 | * | max22- quit (Ping timeout: 268 seconds) |
12:52:30 | * | arkurious joined #nim |
12:58:38 | * | max22- joined #nim |
13:18:06 | * | max22- quit (Ping timeout: 268 seconds) |
13:46:44 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
13:53:42 | FromDiscord | <zevv> treeform#3712\: ping |
13:56:23 | FromDiscord | <Rika> @treeform |
14:08:29 | * | max22- joined #nim |
14:12:10 | * | dbohdan left #nim (#nim) |
14:18:22 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3rPA |
14:20:19 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3rPC |
14:20:36 | FromDiscord | <haxscramper> yes, that's how you should be doing this |
14:21:07 | FromDiscord | <Ayy Lmao> I think the JS backend does something similar, is there any way to tap into what the compiler does there or do I need to implement it manually? |
14:22:00 | FromDiscord | <Ayy Lmao> Because there are a lot of edge cases that are a bit annoying |
14:32:31 | * | Schnouki quit (Ping timeout: 256 seconds) |
14:34:32 | FromDiscord | <Ayy Lmao> @haxscramper Oh yeah, I was also wondering if it is possible to have compileString to tell you line numbers when there are errors in the nim code. Right now it just says the error with no context. |
14:41:10 | * | max22- quit (Ping timeout: 246 seconds) |
14:42:32 | * | supakeen quit (Remote host closed the connection) |
14:42:56 | * | supakeen joined #nim |
14:43:16 | FromDiscord | <haxscramper> There is a `optionsConfig` for `compileString` that accepts `ConfigRef` |
14:43:27 | FromDiscord | <haxscramper> it has `.structuredErrorHook` callback field |
14:43:47 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3rPI |
14:43:50 | FromDiscord | <haxscramper> but you can change to different implementation if you want |
14:44:22 | FromDiscord | <haxscramper> also, in general you would want to use compiler passes instead of `compileString` because you might also need to compile a part of stdlib |
14:44:25 | FromDiscord | <haxscramper> and things like that |
14:44:38 | FromDiscord | <haxscramper> `compileString` does not return other module bodies |
14:46:40 | fn | <ForumUpdaterBot99> New Nimble package! pl0t - Plot and visualize data, see http://pl0t.com |
14:49:54 | * | koltrast quit (Ping timeout: 240 seconds) |
14:50:00 | FromDiscord | <Ayy Lmao> In reply to @haxscramper "also, in general you": Yeah I was wondering about what happens when importing stdlib stuff. So you mean I should be doing the stuff that `compileString` is doing manually? |
14:51:51 | * | koltrast joined #nim |
14:52:00 | FromDiscord | <haxscramper> In reply to @Ayy Lmao "Yeah I was wondering": yes, second argument for `makePass` should generate necessary code |
14:57:48 | * | max22- joined #nim |
14:58:52 | FromDiscord | <Ayy Lmao> In reply to @haxscramper "yes, second argument for": Alright, cool. I have a lot of research ahead of me haha. There's a lot of stuff in there I have no idea what it's doing |
15:08:11 | fn | <ForumUpdaterBot99> New thread by Pedroos: Nested string format error: , see https://forum.nim-lang.org/t/8189 |
15:11:03 | * | pgimeno joined #nim |
15:20:49 | pgimeno | I'm trying to run a network-less build, but it's crashing when attempting to clone Nimble, even though it is already present in the dir. Should I place it somewhere other than the main Nim git directory? This worked with csources_v1. |
15:24:59 | FromDiscord | <Recruit_main707> Programming language battle Royale, letβs go https://m.youtube.com/watch?v=β΅You can submit solutions and I bet you can improve them |
15:25:09 | FromDiscord | <Recruit_main707> bruh |
15:25:50 | FromDiscord | <Recruit_main707> https://m.youtube.com/watch?v=pv4Yq35Chx0 |
15:25:52 | fn | <R2D299> outube: 7"45 Computer Languages Compared: Which is FASTEST?" |
15:25:57 | FromDiscord | <Rika> eh |
15:26:20 | FromDiscord | <Recruit_main707> Sorry discord is shit on phone |
15:30:36 | * | vsantana quit (Quit: vsantana) |
15:32:04 | FromDiscord | <treeform> In reply to @zevv "treeform#3712\: ping": Yes? |
15:32:06 | * | xet7 quit (Remote host closed the connection) |
15:32:50 | * | xet7 joined #nim |
16:17:15 | * | stkrdknmibalz joined #nim |
16:18:37 | * | GreaseMonkey quit (Remote host closed the connection) |
16:19:48 | * | greaser|q joined #nim |
16:28:05 | * | Vladar joined #nim |
16:28:40 | FromDiscord | <levovix> How to get varargs len staticly?β΅For example, to pass it to generic |
16:30:10 | FromDiscord | <haxscramper> You can't statically get number of varargs for a `proc`, they are passed as an array internallly |
16:30:25 | FromDiscord | <haxscramper> You would need to write a macro/template that counts arguments |
16:43:55 | FromDiscord | <konsumlamm> the length of varargs isn't always known statically, since you can also pass a `seq` (or any `openArray`) |
16:55:25 | FromDiscord | <treeform> In reply to @reilly "I'd gladly port Pixie": I started with this: https://www.shadertoy.com/view/ldXyRn |
17:44:29 | fn | <ForumUpdaterBot99> New thread by Scotpip: Parsecsv crashing witn OverflowDefect error, see https://forum.nim-lang.org/t/8190 |
17:52:52 | * | supakeen quit (Remote host closed the connection) |
17:53:16 | * | supakeen joined #nim |
18:28:35 | * | max22- quit (Ping timeout: 268 seconds) |
18:45:26 | * | xet7 quit (Remote host closed the connection) |
18:49:42 | fn | <ForumUpdaterBot99> New question by SlightlyKosumi: Convert uint8 to int, see https://stackoverflow.com/questions/68237261/convert-uint8-to-int |
18:51:45 | * | neceve joined #nim |
18:54:31 | FromDiscord | <RayPals> Hello, Does anyone know of a good starter tutorial for Nim? |
19:04:29 | FromDiscord | <haxscramper> https://nim-by-example.github.io/getting_started/ |
19:05:40 | FromDiscord | <Zoom> @RayPals\: How "sarter" are we talking? The [official ones](https://nim-lang.org/docs/tut1.html) are fine. You can also try [learn Nim in x minutes](https://github.com/adambard/learnxinyminutes-docs/blob/master/nim.html.markdown). Nim wiki has good pages for users with experience in other languages\: https://github.com/nim-lang/Nim/wiki |
19:07:00 | FromDiscord | <dain> question: in a nim macro am I able to "peek inside" a function |
19:07:27 | FromDiscord | <dain> like, if a function is used in the body of the macro, inspect and possibly modify it's AST as if it were inlined |
19:07:37 | FromDiscord | <dain> (edit) "it's" => "its" |
19:09:01 | FromDiscord | <dain> (why i want to do this: I want to make a DSL that is basically nim but you can only use a restricted subset of functions, or [recursively] functions that only use those functions) |
19:09:33 | FromDiscord | <dom96> no, you cannot do this, but you can generate a new function based on the one that's called and then rewrite the ast to call it instead |
19:10:49 | FromDiscord | <dain> hmm |
19:11:47 | FromDiscord | <dain> can I stick attributes onto functions? like how one might use `setattr` in python |
19:12:54 | FromDiscord | <dom96> don't think so |
19:14:44 | FromDiscord | <haxscramper> You might try something with `getInst` for proc symbol |
19:14:59 | FromDiscord | <haxscramper> I'm not sure but maybe this would store all pragma annotations in the implementation |
19:15:21 | FromDiscord | <haxscramper> This works for objects, so you can add custom annotations to types and then check for them via`getTypeInst` |
19:15:29 | FromDiscord | <haxscramper> that returns original source |
19:15:43 | FromDiscord | <haxscramper> maybe it would work the same way for procedures, but I'm not sure |
19:15:45 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=3rRq |
19:17:40 | FromDiscord | <dain> btw my goal for this is to have a text language for defining excel models. it would eventually all compile to an excel spreadsheet. so the only stuff you could use is stuff that has an analogue as an excel formula |
19:19:16 | FromDiscord | <dain> kind of like how you can replace a wysiwyg word processor with LaTeX/markdown and compile it. separation of layout and content |
19:19:52 | FromDiscord | <dain> i tried doing this in python but it was awful looking |
19:23:23 | FromDiscord | <demotomohiro> In reply to @treeform "I started with this:": You might already know, but this looks like efficient way to rendering fonts or some 2D curves on GPU:β΅https://steamcdn-a.akamaihd.net/apps/valve/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf |
19:36:04 | FromDiscord | <exelotl> I always found "Learn Nim in X Minutes" to be really confusing |
19:44:35 | FromDiscord | <exelotl> it's kinda disorganised and starts with the wrong basics (`when`, `discard` and `tuple` ???) |
19:46:06 | * | max22- joined #nim |
19:47:27 | FromDiscord | <konsumlamm> `discard` is quite basic though |
19:53:28 | FromDiscord | <exelotl> yeah fair I'll give them that. But they demonstrate it multiple times too |
19:59:00 | * | Vladar quit (Quit: Leaving) |
19:59:30 | * | leth joined #nim |
20:00:11 | * | leth quit (Quit: nor eason) |
20:11:18 | FromDiscord | <planetis> this is equivalent to `proc some_function(x: int): int {.some_macro.} =`β΅(@dain) |
20:12:51 | FromDiscord | <planetis> can modify a procedure this way |
20:16:51 | FromDiscord | <dain> In reply to @planetis "this is equivalent to": oh neato |
20:16:55 | FromDiscord | <dain> that makes it cleaner |
20:17:15 | FromDiscord | <dain> didn't know you could define custom pragmas |
20:18:12 | FromDiscord | <dain> wait, is this how the `pure` pragma is implemented? scan the function body for any calls to a blacklisted function that performs I/O? |
20:18:33 | FromDiscord | <dain> (edit) "`pure`" => "`noSideEffect`" |
20:36:21 | FromDiscord | <ElegantBeef> Nah no side effect is apart of the compiler |
20:45:55 | FromDiscord | <Quibono> Is there any good comparison between Nim and similar languages like V/Zig? |
20:46:53 | FromDiscord | <konsumlamm> V isn't all that similar tbh |
20:49:02 | FromDiscord | <Quibono> I ask because they're targeting similar niches. |
20:49:17 | FromDiscord | <codic> V is a language that promises far more than what it delivers |
20:49:34 | FromDiscord | <codic> the developer claims far too much that is nowhere near reality at all, i'd stay away from it |
20:50:05 | FromDiscord | <codic> zig is pretty cool but it's more of a C replacement, so you'll usually do more things by hand than nim |
20:50:13 | FromDiscord | <konsumlamm> as for Zig: they have very different philosophies |
20:50:16 | FromDiscord | <codic> does https://github.com/treeform/ws support server side ssl? |
20:50:18 | fn | <R2D299> itHub: 7"Simple WebSocket library for nim." |
20:50:28 | FromDiscord | <codic> yeah zig is very "keep it small, no macros, explicitness" |
20:50:32 | FromDiscord | <codic> whereas nim has lots of syntax sugar |
20:51:06 | FromDiscord | <konsumlamm> ye, Zig has a lot of intentional "limitations", like no GC, no macros, no default arguments |
20:51:19 | FromDiscord | <konsumlamm> the first two are the most significand differences i'd say |
20:51:26 | FromDiscord | <Quibono> Do you think the syntactic sugar is well born out versus the simplistic approach? |
20:51:29 | FromDiscord | <konsumlamm> (although you can technically use Nim without GC) |
20:51:42 | FromDiscord | <konsumlamm> "well born out"? |
20:52:12 | FromDiscord | <Quibono> Erm, is it worth it? I think limited options as to how you do things can wind up being nice. |
20:52:25 | FromDiscord | <konsumlamm> imo definitely, but ymmv |
20:53:07 | FromDiscord | <vindaar> I feel like half of my libraries would be more verbose without it π
β΅(@Quibono) |
20:53:37 | FromDiscord | <ElegantBeef> Different strokes for different folks, but Vlang is for no one π |
20:53:53 | FromDiscord | <Quibono> Eh, i actually find V to not be that bad nowadays |
20:53:59 | FromDiscord | <Quibono> But different conversation |
20:54:14 | FromDiscord | <haxscramper> they did full rewrite of the compiler since the start IIRC |
20:54:37 | FromDiscord | <konsumlamm> at some point the author realized that the promise of not using an AST isn't realistic |
20:54:39 | FromDiscord | <haxscramper> so it's like completely different implementation, aside from basic syntax |
20:55:17 | FromDiscord | <haxscramper> Also very strange project planning when they are offically writing an os in V |
20:55:26 | FromDiscord | <konsumlamm> V has so many false promises that i wouldn't even wanna use it if it was good some day |
20:55:44 | FromDiscord | <Quibono> They definitely use an ast, idk when they rewrote it, and yeah the OS is ongoing |
20:55:45 | FromDiscord | <haxscramper> they have excess contributors or something |
20:55:58 | FromDiscord | <haxscramper> OS, browser, compiler, editor |
20:56:02 | FromDiscord | <konsumlamm> In reply to @Quibono "They definitely use an": ye, but the author originally claimed that it won't need an AST |
20:56:25 | FromDiscord | <Quibono> In reply to @konsumlamm "ye, but the author": Yeah fair he over promises, the language isnβt as bad as people make it seem tho. |
20:56:35 | FromDiscord | <ElegantBeef> They also claimed no memory leaks without GC or a RC π |
20:56:46 | FromDiscord | <ElegantBeef> So that bitch leaked |
20:56:57 | FromDiscord | <konsumlamm> it was that bad at some point though |
20:57:01 | FromDiscord | <konsumlamm> maybe it's better now7 |
20:57:20 | FromDiscord | <konsumlamm> half the "WIP"s are still not implemented though |
20:57:52 | FromDiscord | <haxscramper> they certainly have a lot of attention though |
20:58:08 | FromDiscord | <haxscramper> And since people are into "minimal" languages these days |
20:58:13 | FromDiscord | <konsumlamm> and look, now it uses a GC afaik, after claiming that "memory management will be like Rust but wthout ownership/borrowing" |
20:58:30 | FromDiscord | <haxscramper> btw, I think ARC is close to what they claim to add |
20:58:37 | FromDiscord | <haxscramper> really close |
20:58:46 | FromDiscord | <konsumlamm> In reply to @haxscramper "And since people are": it's not as minimal as people make it out to be from what i've seen |
20:58:49 | FromDiscord | <haxscramper> no GC, deterministic, no borrowing |
20:58:55 | FromDiscord | <konsumlamm> and a lot of stuff is builtin, that shouldn't be |
20:59:01 | FromDiscord | <Quibono> So yeah they basically use a GC for part of it and then βautofreeβ which is basically comptime reference counting. |
20:59:05 | FromDiscord | <konsumlamm> In reply to @haxscramper "no GC, deterministic, no": ARC is definitely a GC in my mind |
20:59:21 | FromDiscord | <ElegantBeef> Well it's memory management but it's not a garbage collector |
21:00:20 | FromDiscord | <haxscramper> In reply to @konsumlamm "it's not as minimal": they don't have `while` loop https://github.com/vlang/v/blob/master/doc/docs.md#bare-for |
21:00:27 | FromDiscord | <haxscramper> `minimal` confirmed |
21:00:31 | FromDiscord | <Quibono> So anyway, yaβll should try it, but Iβm more interested in /Why Nim/ |
21:00:52 | FromDiscord | <konsumlamm> In reply to @haxscramper "they don't have `while`": ye, because they use `for` for 5 different things, including while loops |
21:00:59 | FromDiscord | <ElegantBeef> macros, lovely syntax, pretty good CTE |
21:01:01 | FromDiscord | <konsumlamm> so it has while loops, they're just called for loops |
21:01:15 | FromDiscord | <haxscramper> In reply to @konsumlamm "ARC is definitely a": well, that mostly a PR talk, really. I don't care about concrete definitions, but since people sometimes have weird reactions to GC |
21:01:40 | FromDiscord | <haxscramper> And really into "no GC" sometimes |
21:01:48 | FromDiscord | <konsumlamm> that's another issue |
21:02:00 | FromDiscord | <konsumlamm> In reply to @ElegantBeef "Well it's memory management": according to wikipedia it is :P |
21:02:08 | FromDiscord | <ElegantBeef> Indeed π |
21:02:19 | FromDiscord | <haxscramper> but I personally don't have enough expertise to argue how we should call ARC |
21:02:45 | FromDiscord | <haxscramper> In reply to @Quibono "So anyway, yaβll should": C++ interop |
21:03:02 | FromDiscord | <haxscramper> Probably the best you can get, though haxe might be better |
21:03:09 | FromDiscord | <Quibono> CTE? |
21:03:10 | FromDiscord | <haxscramper> but they've build whole language around this |
21:03:15 | FromDiscord | <ElegantBeef> Compile time evaluation |
21:03:16 | FromDiscord | <konsumlamm> honestly, i (personally) would use orc over arc any time anyway |
21:03:26 | FromDiscord | <haxscramper> well, yes, orc will be default |
21:03:30 | FromDiscord | <ElegantBeef> Well ofc cause it only introduces cycle collection where needed |
21:03:32 | FromDiscord | <konsumlamm> i'm not confident enough to be sure that i'd never make ref cycles |
21:03:33 | FromDiscord | <ElegantBeef> So no cycles = arc π |
21:04:01 | FromDiscord | <konsumlamm> but i can't imagine any useful definition of GC that wouldn't include orc |
21:04:21 | FromDiscord | <ElegantBeef> Eh it think it's a moot thing to debate about, more merits in functional use and benefits |
21:05:17 | FromDiscord | <haxscramper> `ref bool` |
21:05:47 | FromDiscord | <konsumlamm> In reply to @Quibono "CTE?": that's one of the most unique features of Nim: you can call almost any function at compile time |
21:06:09 | FromDiscord | <konsumlamm> together with the macro system, which allows you transform Nim code at compile time (using Nim code) |
21:06:47 | FromDiscord | <haxscramper> In reply to @Quibono "So anyway, yaβll should": To be honest I sometimes find this question kind of hard to answer, because if I start just listing language features, some of them might need somewhat boring explanation |
21:07:01 | FromDiscord | <haxscramper> but in general I find nim to be in line of how I want to do things |
21:07:24 | FromDiscord | <haxscramper> language does what I want it to and not being too smart about "the one way" to do things |
21:07:43 | FromDiscord | <haxscramper> I don't like these "one way" languages, so |
21:07:45 | FromDiscord | <konsumlamm> In reply to @Quibono "So anyway, yaβll should": i'm curious what you like so much about it though, it doesn't have any interesting features imo, other than "being fast" ig (as long as you don't encounter a bug :P) |
21:09:08 | FromDiscord | <haxscramper> it can be considered a better go, at least if you don't do threading/async whatever google optimized go for |
21:09:19 | FromDiscord | <haxscramper> and people like go for some reason |
21:09:27 | FromDiscord | <konsumlamm> ~~i don't understand that either~~ |
21:11:46 | FromDiscord | <Quibono> Itβs fast, simple, active community, I kinda do like the βone wayβ mentality to an extent... uh, yeah pretty much that. I like that it mostly doesnβt have a GC although Iβd like that to be more true |
21:12:09 | FromDiscord | <haxscramper> do you write high-performance code? |
21:12:15 | FromDiscord | <haxscramper> like hard realtime? |
21:12:33 | FromDiscord | <Quibono> I want to yes. |
21:12:57 | FromDiscord | <Quibono> Soft real-time at least. |
21:14:07 | FromDiscord | <dom96> In reply to @konsumlamm "that's one of the": these days there is actually many more languages that support it, D, Zig, Rust |
21:14:26 | FromDiscord | <konsumlamm> ye, but it's still not very wide spread |
21:14:42 | FromDiscord | <konsumlamm> and as much as i like Rust, it's CTFE can't be compared to that of Nim or D |
21:15:07 | FromDiscord | <Canelhas> sent a long message, see http://ix.io/3rRR |
21:15:32 | FromDiscord | <konsumlamm> i only wish it didn't have so many bugs π
|
21:15:44 | FromDiscord | <dom96> so I'm lacking context, what are we discussing? π |
21:15:49 | FromDiscord | <konsumlamm> Nim |
21:15:54 | FromDiscord | <Canelhas> In reply to @dom96 "so I'm lacking context,": why nim |
21:16:03 | FromDiscord | <haxscramper> one of the very nice features of nim is support for lazy evaluation |
21:16:09 | FromDiscord | <konsumlamm> wat |
21:16:11 | FromDiscord | <haxscramper> no haskell-level |
21:16:17 | FromDiscord | <haxscramper> but you can get smart with templates |
21:16:35 | FromDiscord | <dom96> In reply to @Canelhas "why nim": ahh cool, for me no other language fits the bill of "fast Python" |
21:16:46 | FromDiscord | <konsumlamm> any language with closures/lambdas can implement lazy evaluation though |
21:16:54 | FromDiscord | <dom96> Nim is just as expressive as Python and gives me compiled binaries |
21:17:08 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3rRS |
21:17:22 | FromDiscord | <haxscramper> Idk, but I think this too is called lazy |
21:17:24 | FromDiscord | <Canelhas> the only thing that i wish was better is toolingβ΅i'm a pleb using vscode + win10β΅and tooling isn't quite there yet |
21:17:42 | FromDiscord | <haxscramper> but that's not what regular definition of lazy evaluiation means of course |
21:17:44 | FromDiscord | <Canelhas> ( but i come from java so i might be spoiled in that regard ) |
21:18:25 | FromDiscord | <konsumlamm> the most annoying part imo is that error highlighting only highlights the first character |
21:21:50 | FromDiscord | <haxscramper> also bitsets, variant types and arrays |
21:22:08 | FromDiscord | <haxscramper> if I were to choose one feature that I wanted to add to every language, it would probably be this one |
21:22:40 | FromDiscord | <haxscramper> all nim's `enum`-related stuff is just great |
21:23:08 | FromDiscord | <haxscramper> When #368 is implemented, it would be almost perfect |
21:23:28 | FromDiscord | <Canelhas> In reply to @haxscramper "When #368 is implemented,": whats changing? |
21:23:43 | FromDiscord | <haxscramper> you can have same field in different branches |
21:24:17 | FromDiscord | <haxscramper> well, the syntax looks a little different but the behavior matches |
21:29:23 | FromDiscord | <ElegantBeef> The contains -> `in` and `notin` is fantastic π |
21:31:21 | FromDiscord | <haxscramper> `if len(myset {flag1, flag2}) > 0` |
21:31:35 | FromDiscord | <haxscramper> `myset β© {flag1, flag2}` |
21:36:25 | * | greaser|q quit (Changing host) |
21:36:25 | * | greaser|q joined #nim |
21:36:27 | * | greaser|q is now known as GreaseMonkey |
21:39:05 | FromDiscord | <Bung> https://github.com/bung87/lsp_client/blob/master/tests/test1.nim I get io error ommunication to nimlsp server use asynctools, any idea? |
21:52:26 | FromDiscord | <Jasmine and Don't Forget!~> I actually don't have a job! it was an mlm |
21:52:45 | FromDiscord | <Jasmine and Don't Forget!~> Woot! woot! |
21:55:55 | FromDiscord | <mratsim> wot? |
21:58:57 | FromDiscord | <Jasmine and Don't Forget!~> Yeah, an old coworker was like here's a job and I needed a job and it was a pyramid scheme |
22:01:24 | FromDiscord | <codic> does https://github.com/treeform/ws support server side ssl? |
22:01:27 | fn | <R2D299> itHub: 7"Simple WebSocket library for nim." |
22:06:30 | FromDiscord | <mratsim> Yet another weekend lost fighting/setuping CI :/ |
22:06:55 | FromDiscord | <ElegantBeef> Just use NI also known as Never Intergration π |
22:07:00 | FromDiscord | <vindaar> I was just looking at github and seeing your last pushes. Sorry to hear it ποΈ |
22:07:57 | FromDiscord | <codic> or is it nim integration |
22:09:13 | FromDiscord | <treeform> In reply to @demotomohiro "You might already know,": I have read this before, but still tanks for sending it! |
22:11:06 | FromDiscord | <treeform> In reply to @codic "does https://github.com/treeform/ws support server": No it does not. But is a bad idea. What I do is wrap it with nginx with letsencrypt, much better then supporting it internally. |
22:11:08 | fn | <R2D299> itHub: 7"Simple WebSocket library for nim." |
22:11:34 | FromDiscord | <garett> sent a code paste, see https://play.nim-lang.org/#ix=3rS3 |
22:12:00 | FromDiscord | <treeform> In reply to @codic "does https://github.com/treeform/ws support server": You can also wrap it with cloudflare, even simpler. |
22:12:02 | fn | <R2D299> itHub: 7"Simple WebSocket library for nim." |
22:12:02 | FromDiscord | <codic> In reply to @treeform "No it does not.": oh that is a good idea |
22:12:46 | FromDiscord | <treeform> SSL is complex and I would just rather others handle it. |
22:13:21 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3rS4 |
22:19:06 | * | neceve quit (Ping timeout: 240 seconds) |
22:23:46 | FromDiscord | <PressF> Hey people.β΅I'm thinking about going throw a book on Nim live after my exams are over. Any free book suggestion (something like rust's book or "learn Go with tests") |
22:46:55 | FromDiscord | <ElegantBeef> Book wise there isnt much out there, do have http://ssalewski.de/nimprogramming.html though. |
22:47:12 | FromDiscord | <ElegantBeef> Also "Nim in Action" but that isnt free |
22:59:30 | fn | <ForumUpdaterBot99> New thread by Iortega: Cannot properly internationalize, see https://forum.nim-lang.org/t/8191 |
23:03:21 | FromDiscord | <aleclarson> Can I take ownership of a ref, so I have to dealloc it manually or it leaks? |
23:03:53 | FromDiscord | <aleclarson> (edit) "Can I take ownership of a ref, so ... I`dealloc`" added "that" | "dealloc" => "`dealloc`" |
23:04:04 | FromDiscord | <aleclarson> (edit) "Can I take ownership of a ref, so that I have to `dealloc` it manually or ... it" added "else" |
23:04:13 | FromDiscord | <ElegantBeef> You mean of an already existent ref? |
23:04:17 | FromDiscord | <aleclarson> Right |
23:06:03 | FromDiscord | <ElegantBeef> If you can, I imagine it'd depend on the GC you're using so probably inadvisable |
23:06:08 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3rSc |
23:07:21 | FromDiscord | <ElegantBeef> There is a `GC_unref` though |
23:07:37 | FromDiscord | <haxscramper> It evaluates argument as a tuple and just uses first or second field |
23:08:10 | FromDiscord | <ElegantBeef> Yea so you'd `GC_ref(yourRef)` then to dealloc it you'd `GC_unref(yourRef)` |
23:08:17 | FromDiscord | <ElegantBeef> Though i do wonder if that has any implications on arc |
23:08:52 | FromDiscord | <treeform> In reply to @codic "so I just set": Yeah, I have single entry for whole server, no need to do it per path |
23:15:35 | FromDiscord | <aleclarson> In reply to @ElegantBeef "Yea so you'd `GC_ref(yourRef)`": Oh interesting thx! |
23:18:30 | FromDiscord | <treeform> In reply to @codic "so I just set": https://seanthegeek.net/1035/how-to-configure-a-nginx-reverse-proxy-with-lets-encrypt-certificates/ this is the setup I used. Certbot and nginx. |
23:21:31 | * | max22- quit (Remote host closed the connection) |
23:44:28 | FromDiscord | <ββ> why is this not working? |
23:44:29 | FromDiscord | <ββ> sent a code paste, see https://play.nim-lang.org/#ix=3rSh |
23:46:18 | FromDiscord | <exelotl> Nim's case insensitivity does not apply to the first character in an identifier |
23:47:02 | FromDiscord | <ββ> i see |
23:47:25 | FromDiscord | <exelotl> this is useful to prevent variables and types from clashingβ΅e.g. `var foo: Foo` is allowed |
23:47:43 | FromDiscord | <ββ> this feature does not support greek letters? |
23:48:11 | FromDiscord | <exelotl> hmm I imagine not |
23:48:23 | FromDiscord | <ββ> why |
23:49:00 | FromDiscord | <exelotl> I would assume it only works for ASCII but I've never tried it |
23:51:03 | FromDiscord | <ββ> it seems you are correct from my test |
23:51:11 | FromDiscord | <ββ> now the question is why does it not support greek |
23:55:19 | FromDiscord | <ElegantBeef> Cause unicode is complex |
23:55:55 | FromDiscord | <ElegantBeef> Ascii is simple to lowercase unicode is complicated to do |
23:56:27 | FromDiscord | <ββ> if the reason is it would be too complex to implement i would not have had it work for just latin characters |
23:56:38 | FromDiscord | <ElegantBeef> Well ascii is what most people use |
23:57:16 | FromDiscord | <exelotl> the main purpose of the feature is to allow you to use whatever style you want in your own project, even if the libraries you depend on are using a different style |
23:57:31 | FromDiscord | <ββ> what about non english speakers |
23:58:31 | FromDiscord | <exelotl> it's very unlikely that a library would be exporting an API with non ascii glyphs in it's public API |
23:58:33 | FromDiscord | <ElegantBeef> Well then you dont benefit from it anyway |
23:58:53 | FromDiscord | <exelotl> (edit) "an API" => "identifiers" |
23:59:26 | FromDiscord | <ElegantBeef> How much code is written in a language with unicode characters as the exported symbols? |