00:11:16 | FromDiscord | <theangryepicbanana> poggers I got generic interfaces working in nim https://replit.com/@theangryepicbanana/nim-interface-test |
00:11:27 | FromDiscord | <theangryepicbanana> takes about a minute to compile, have fun |
00:11:32 | FromDiscord | <ElegantBeef> jeez |
00:11:40 | FromDiscord | <theangryepicbanana> yeah |
00:11:48 | FromDiscord | <theangryepicbanana> and that's without extra RTTI lol |
00:12:02 | FromDiscord | <theangryepicbanana> typeinfo adds another 1-2 mins |
00:12:34 | FromDiscord | <theangryepicbanana> also type errors cause an infinite loop, unsure how to fix |
00:12:40 | FromDiscord | <theangryepicbanana> (edit) "also type ... errors" added "mismatch" |
00:18:22 | FromDiscord | <ElegantBeef> @Kimmy it's not elegant but it's a workaround https://play.nim-lang.org/#ix=3wCR |
00:18:55 | FromDiscord | <ElegantBeef> Well it was wron in the template, but still works |
00:31:56 | * | [R] quit (Quit: No Ping reply in 180 seconds.) |
00:32:04 | * | [R] joined #nim |
00:39:46 | FromDiscord | <⃟⃟> new thing i found |
00:39:50 | FromDiscord | <⃟⃟> `a.x` |
00:40:11 | FromDiscord | <⃟⃟> is this accessing the field named `x` in sturct `a` or calling function `x` on it |
00:40:23 | FromDiscord | <Elegantbeef> Could be any |
00:40:41 | FromDiscord | <⃟⃟> and thats what i dont like |
00:41:17 | FromDiscord | <Elegantbeef> Well... this is Nim |
00:41:18 | FromDiscord | <⃟⃟> this language is feeling more like c++ with the more i think about it |
00:41:26 | FromDiscord | <⃟⃟> where everything is so context dependent |
00:41:31 | FromDiscord | <theangryepicbanana> c++ doesn't do that lol |
00:41:32 | FromDiscord | <⃟⃟> even the import statement is |
00:41:35 | FromDiscord | <⃟⃟> i know it dosent |
00:41:40 | FromDiscord | <⃟⃟> i didnt say it did |
00:41:43 | FromDiscord | <theangryepicbanana> why would you even need to distinguish those things in the first place |
00:41:48 | FromDiscord | <⃟⃟> i said it feels ""like"" C++ |
00:41:56 | FromDiscord | <Elegantbeef> But it doesnt feel like C++ |
00:42:13 | FromDiscord | <theangryepicbanana> if you need `x(a)` and `a.x` to do different things, then your code doesn't sound very clean |
00:42:25 | FromDiscord | <theangryepicbanana> and yeah, this is miles better than c++ lol |
00:42:50 | FromDiscord | <⃟⃟> its about clearity, these features make code less clear when these features are used |
00:43:42 | FromDiscord | <Elegantbeef> How is it clarity if it's a proc, a property or a method |
00:43:57 | FromDiscord | <⃟⃟> nim has methods? |
00:44:01 | FromDiscord | <Elegantbeef> Yes |
00:44:10 | * | [R] quit (Ping timeout: 240 seconds) |
00:44:17 | FromDiscord | <⃟⃟> i think i missed those in the manual |
00:44:21 | FromDiscord | <⃟⃟> can you show me how they look |
00:44:37 | FromDiscord | <Elegantbeef> `method yourMethodName(someRefObj: SomeRefType)` |
00:45:12 | FromDiscord | <Elegantbeef> Let's look at treeforms vmath library, he has multiple different base vectors, and does it really matter his `.x` is a template that gets the x component? |
00:45:37 | FromDiscord | <⃟⃟> ok i see this method thing now |
00:45:56 | FromDiscord | <⃟⃟> its basically a function in terms of syntax |
00:45:56 | FromDiscord | <Elegantbeef> If you're concerned what a symbol is you have tooling use it |
00:46:06 | FromDiscord | <Elegantbeef> Well it's a dynamically dispatched procedure |
00:46:26 | FromDiscord | <⃟⃟> its not about being "concerned", i dont want to spend my time deciphering what some code is doing |
00:46:37 | FromDiscord | <theangryepicbanana> they should all function the same, no? |
00:46:38 | FromDiscord | <⃟⃟> (edit) "its not about being "concerned", i dont want to spend my time deciphering what some code is doing ... " added "because the syntax is confusing" |
00:47:00 | FromDiscord | <⃟⃟> according to the manual methods use dynamic dispatch |
00:47:07 | FromDiscord | <theangryepicbanana> yes that's intentional |
00:47:13 | FromDiscord | <⃟⃟> so they dont function the same |
00:47:14 | FromDiscord | <theangryepicbanana> `a.x` does not imply a method |
00:47:22 | FromDiscord | <Elegantbeef> `if httpClient.code notin HttpCode200..HttpCode207` how is this worse than `if httpClient.code() notin HttpCode200..HttpCode207`? |
00:47:27 | FromDiscord | <theangryepicbanana> methods are just funcs that are attatched to the object |
00:47:35 | FromDiscord | <theangryepicbanana> like `virtual` in c++ |
00:47:55 | FromDiscord | <Elegantbeef> They're overridable procedures that are dispatched at runtime |
00:48:04 | FromDiscord | <Elegantbeef> They behave identically to procedures aside from that |
00:48:54 | FromDiscord | <⃟⃟> that seems like a pretty good example actually, if i saw you accessing some "code" from a http client i would probably have to check if im calling a function or its a field access |
00:49:16 | FromDiscord | <Elegantbeef> But why does it matter? |
00:49:23 | FromDiscord | <⃟⃟> atleast they didnt do `not in` instead of `notin` |
00:49:26 | FromDiscord | <⃟⃟> like python |
00:49:36 | FromDiscord | <⃟⃟> because now everything is less clear on what its doing |
00:49:51 | FromDiscord | <⃟⃟> a field access has differences to calling a function |
00:50:08 | FromDiscord | <⃟⃟> not just performance ones too |
00:50:15 | FromDiscord | <Elegantbeef> If you have a performance issue cause you're calling a function instead of getting a property you're in a good place |
00:50:27 | FromDiscord | <Elegantbeef> Is your tooling really that bad it doesnt tell you what it is? |
00:51:45 | FromDiscord | <⃟⃟> if i cant write code comfortably without using some fancy tools its probably a sign theres some design flaw |
00:54:18 | FromDiscord | <Elegantbeef> I dont see it as an issue since if the code is written well it's a non issue |
00:54:49 | FromDiscord | <⃟⃟> well then either the code example you just showed me is a poorly written or it is an issue |
00:55:01 | FromDiscord | <Elegantbeef> How is it poorly written? |
00:55:24 | FromDiscord | <⃟⃟> you tell me |
00:55:34 | FromDiscord | <theangryepicbanana> it was an example lol |
00:55:50 | FromDiscord | <Elegantbeef> Well let's look at that example |
00:56:00 | FromDiscord | <Elegantbeef> Should you set the code of a http response? No |
00:56:29 | FromDiscord | <Elegantbeef> Ok so that means it shouldnt be a settable value, so now we know it's not a `var HttpCode` |
00:57:14 | FromDiscord | <⃟⃟> i dont understand what youre saying anymore |
00:57:25 | FromDiscord | <Elegantbeef> So now let's look at the source ` return response.status[0 .. 2].parseInt.HttpCode` is the `code` accessor |
00:57:43 | FromDiscord | <⃟⃟> source of what? |
00:57:51 | FromDiscord | <Elegantbeef> the `httpclient.code` |
00:58:12 | FromDiscord | <⃟⃟> so you have to look at the source code to tell me if its a field access or function call? |
00:58:17 | FromDiscord | <Elegantbeef> Nope |
00:58:39 | FromDiscord | <Elegantbeef> I'm using my braincells to talk about how you know it's not a field by looking at it |
00:58:50 | FromDiscord | <Elegantbeef> you'd never set the `code` of a `httpresponse` that makes 0 sense to do |
00:59:04 | FromDiscord | <Elegantbeef> So since we're in a language with the ability to limit access it's certainly a getter |
00:59:25 | FromDiscord | <Elegantbeef> Which when you look at the source you can see it's a relatively cheap getter that parses the stored code |
00:59:41 | FromDiscord | <Elegantbeef> No tooling required aside from your brain |
01:00:16 | FromDiscord | <⃟⃟> so essentially to figure out what code did you↵1. had to make an assumption about how the library works↵2. looked at the source code↵3. looked at the source again? |
01:00:27 | FromDiscord | <⃟⃟> heres how its done in go |
01:00:38 | FromDiscord | <⃟⃟> httpClient.code() |
01:00:39 | FromDiscord | <Elegantbeef> Well to figure out what the code did i looked at the source, like you should do |
01:00:45 | FromDiscord | <⃟⃟> thats a method call |
01:00:49 | FromDiscord | <⃟⃟> httpClient.code |
01:00:53 | FromDiscord | <⃟⃟> thats a field access |
01:00:57 | FromDiscord | <Elegantbeef> Oh i missed day one of Nim where the language was called `Go` |
01:01:09 | FromDiscord | <⃟⃟> it was? |
01:01:28 | FromDiscord | <Elegantbeef> Well you seem to think it was |
01:01:54 | FromDiscord | <⃟⃟> i was showing you a different language as an example |
01:02:05 | FromDiscord | <⃟⃟> its more clear in go without this feature |
01:02:37 | FromDiscord | <Elegantbeef> what about go's templates/macros? |
01:02:41 | FromDiscord | <Elegantbeef> Oh right |
01:04:59 | FromDiscord | <Yardanico> In reply to @Elegantbeef "Oh right": XD |
01:05:06 | FromDiscord | <Elegantbeef> so how about setters? |
01:05:25 | FromDiscord | <Elegantbeef> `someVector.x() = 100`? |
01:06:04 | FromDiscord | <⃟⃟> what |
01:06:47 | FromDiscord | <Elegantbeef> You can have properties that set internal values |
01:07:03 | FromDiscord | <Elegantbeef> How do you manage that without hiding it as a field? |
01:07:19 | FromDiscord | <⃟⃟> whats a "property" |
01:07:28 | FromDiscord | <⃟⃟> what is "hiding it as a field" |
01:07:39 | FromDiscord | <Elegantbeef> A property is a field that is only accessed with getters/setters |
01:07:55 | FromDiscord | <Elegantbeef> This way you control the logic to get to/from it |
01:08:30 | FromDiscord | <⃟⃟> you would do `SetX` ? |
01:08:40 | FromDiscord | <⃟⃟> (edit) "`SetX`" => "`v.SetX(100)`" |
01:08:42 | FromDiscord | <Elegantbeef> no you'd do `someVector.x = 100` |
01:09:03 | FromDiscord | <⃟⃟> i thought you wanted a setter |
01:10:15 | FromDiscord | <Elegantbeef> that's a setter |
01:10:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3wCZ |
01:10:30 | FromDiscord | <Elegantbeef> hence the `=` |
01:10:53 | FromDiscord | <⃟⃟> so now theres even more confusion on whats happening |
01:11:24 | FromDiscord | <Elegantbeef> Almost like it only matters when it's an issue, and it's hardly ever an issue. If using a setter/getter is the bottleneck you have very few worries |
01:11:53 | FromDiscord | <Elegantbeef> C# is a language that has extensive usage of properties like this and they're doing well, so hardly seems like an issue |
01:11:55 | FromDiscord | <⃟⃟> performance is not the issue for me |
01:12:47 | FromDiscord | <⃟⃟> and c++/python are more popular than nim |
01:12:54 | FromDiscord | <⃟⃟> do you think they are better? |
01:13:26 | FromDiscord | <Elegantbeef> Who said anything about better |
01:14:14 | FromDiscord | <⃟⃟> "they're doing well" |
01:14:46 | FromDiscord | <Elegantbeef> C# is a relatively popular language that uses getters/setters abundantly and the code is still written without hassle |
01:15:19 | FromDiscord | <⃟⃟> i dont know how it works in that language |
01:15:25 | FromDiscord | <Elegantbeef> It's not about better it's about "does it take away or add to the language" and i think setters/getters add not take away as do probably most Nim programmers |
01:15:47 | FromDiscord | <theangryepicbanana> getters/setters are just syntax sugar for fields to make their syntax look consistent |
01:16:09 | FromDiscord | <theangryepicbanana> nobody like java's common `obj.getFoo()` and `obj.setFoo(value)` pattern |
01:16:11 | FromDiscord | <theangryepicbanana> (edit) "like" => "likes" |
01:16:30 | FromDiscord | <Elegantbeef> You'd be hardpressed to break all the nim code that exists for this change |
01:16:32 | FromDiscord | <theangryepicbanana> so instead, getters/setters let you do `obj.foo` and `obj.foo = value` |
01:17:03 | FromDiscord | <theangryepicbanana> they're very common in modern languages, and can even be optimized to not add overhead |
01:17:20 | FromDiscord | <⃟⃟> i think i would rather have what java does |
01:17:25 | FromDiscord | <theangryepicbanana> oh? |
01:17:43 | FromDiscord | <theangryepicbanana> so then you'd want field access to look different from property access? |
01:17:56 | FromDiscord | <theangryepicbanana> sounds like a massive pain to me |
01:18:02 | FromDiscord | <Elegantbeef> That's the first time someone looked at java and said "Yea i want some of that" |
01:18:20 | FromDiscord | <theangryepicbanana> honestly, I've done my fair share of java and it's not great |
01:18:33 | FromDiscord | <exelotl> yeah one of the biggest reasons I'm using Nim is because of nice sugar like this |
01:19:00 | FromDiscord | <Elegantbeef> You dont like `vectorA.add(vectorB);`? 😛 |
01:19:29 | FromDiscord | <Elegantbeef> On top of it can also be 0 cost so there is no reason to make it a procedure call |
01:19:30 | FromDiscord | <⃟⃟> `v1 + v2` can be accomplished without adding this confusion |
01:19:47 | FromDiscord | <theangryepicbanana> operator overloading is the same thing as getters/setters |
01:21:51 | FromDiscord | <Elegantbeef> Nim is not an overly verbose language, being expressive is one of it's goals |
01:24:46 | FromDiscord | <exelotl> if you want explicitness Zig is probably for you. Personally I don't mind the mental overhead/time taken in Nim to figure out whether foo.a is a procedure call, field, iterator, template/macro, etc. |
01:25:24 | FromDiscord | <⃟⃟> i dont like that language because of the person running it |
01:25:46 | FromDiscord | <exelotl> o |
01:25:57 | FromDiscord | <Elegantbeef> Turns out very few languages actually lack this syntax sugar |
01:26:34 | FromDiscord | <theangryepicbanana> yeah I think it's just java, c, and c++ |
01:26:51 | FromDiscord | <⃟⃟> + go |
01:26:53 | FromDiscord | <⃟⃟> + mathematica |
01:26:55 | FromDiscord | <Elegantbeef> Go, Zig |
01:27:36 | FromDiscord | <theangryepicbanana> still not as many as those that support it |
01:28:55 | FromDiscord | <theangryepicbanana> anyways, unrelated issue: can I have a variadic user-defined pragma? if so, how? |
01:31:06 | FromDiscord | <theangryepicbanana> nvm, I'll just not have a trailing argument ._. |
01:31:32 | FromDiscord | <Elegantbeef> Well might be time to checkout odin or hare lang and hope those tickle your fancy |
01:31:32 | FromDiscord | <Elegantbeef> Though they're both relatively new \:D |
01:31:33 | FromDiscord | <Elegantbeef> Cause based off your issues over the past 2 days Nim doesnt seem like it's for you, it's full of making life easier by hiding details that dont matter |
01:32:35 | FromDiscord | <Elegantbeef> Well let me answer the question anyway |
01:32:36 | FromDiscord | <Elegantbeef> What do you mean |
01:45:39 | FromDiscord | <exelotl> > it's full of making life easier by hiding details that dont matter↵this ^ |
01:49:39 | FromDiscord | <Elegantbeef> Dont agree with me too much exelotl might go to my head |
02:01:17 | * | audiophile_ quit (Quit: Default Quit Message) |
02:01:52 | * | audiophile_ joined #nim |
02:03:09 | FromDiscord | <Kimmy> In reply to @ElegantBeef "<@!376850432540147712> it's not elegant": oh that’s fascinating! I’ll have to study why this works |
02:03:44 | FromDiscord | <Kimmy> (edit) "works" => "works, thanks for the hint!" |
02:04:48 | * | audiophile_ quit (Client Quit) |
02:17:42 | * | diamond joined #nim |
02:17:54 | diamond | Hi |
02:18:44 | FromDiscord | <Yardanico> hi |
02:18:53 | FromDiscord | <Elegantbeef> Hello |
02:20:33 | diamond | I love Nim, but I don't know what can I do with it |
02:20:39 | diamond | I want to start a project |
02:21:09 | FromDiscord | <Elegantbeef> You can do a lot with it, so any single subject catch your eye? |
02:29:01 | FromDiscord | <Canelhas> there is a compiler option to allow declaring procs out of order, if i'm not mistaken↵which is it ?↵what is the reasoning behind it not being default? https://media.discordapp.net/attachments/371759389889003532/878828073871614002/unknown.png |
02:29:52 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#code-reordering Nim has a bunch of features implemented which may not be fully function which is why, also some people are opposed to things like iit |
02:30:45 | FromDiscord | <Canelhas> In reply to @Elegantbeef "https://nim-lang.org/docs/manual_experimental.html#": why would anyone be opposed to qol things like this? |
02:31:21 | FromDiscord | <Elegantbeef> Cause it makes it harder to read code since the logic can be declared after where you are |
02:32:14 | FromDiscord | <Canelhas> is there any way i could write this without code reorder? https://media.discordapp.net/attachments/371759389889003532/878828882856390727/unknown.png |
02:32:28 | FromDiscord | <Elegantbeef> Forward declare the procedure |
02:33:13 | FromDiscord | <Elegantbeef> `proc parseExpression(parser: var Parser): Option[Expression]` before your `parsePrefixExpression` and it'll work without code reorder |
02:33:36 | FromDiscord | <Canelhas> i see↵thank you very much |
02:34:16 | FromDiscord | <Elegantbeef> It's arguably better than code reordering since it's explicitly saying "Hey here this is accessible but will be given a body later" |
02:35:48 | FromDiscord | <Canelhas> doesn't really solve the "code is harder to read because logic is declared after"↵i don't even agree with the code is harder to read part, but whatever |
02:36:39 | FromDiscord | <Elegantbeef> To each their own, i dont necessarily agree with what i said just was giving a reason some asy |
02:37:39 | FromDiscord | <Canelhas> yeah, i understand that↵thanks for the tips↵beef being helpful as always |
02:39:08 | * | diamond quit (Quit: Leaving) |
02:48:07 | * | arkurious quit (Quit: Leaving) |
02:58:21 | FromDiscord | <Elegantbeef> @treeform\: Sorry to bother you, but i'm trying to draw a circle that goes black to white along it's length, and this is close but seems I'm missing something with the gradient handles, present code\: https://play.nim-lang.org/#ix=3wDg |
02:59:46 | FromDiscord | <Elegantbeef> Expecting something like this but only a circle segment |
02:59:47 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/878835819002101760/image.png |
03:08:02 | FromDiscord | <treeform> gradient handles are not intuitive, let me see if I can fix it |
03:09:30 | FromDiscord | <treeform> why do you stroke if you want fill? |
03:10:31 | FromDiscord | <Elegantbeef> I dont want a fill, i want a segment of the above shape |
03:10:41 | FromDiscord | <Elegantbeef> Was best example i could find without making it in an art program |
03:10:49 | FromDiscord | <retkid> https://github.com/mozilla/rhino |
03:10:52 | nrds | <prestigebot99> itHub: 7"Rhino is an open-source implementation of JavaScript written entirely in Java" |
03:10:59 | FromDiscord | <retkid> you think i can use this to leapfrog my way into jim-java |
03:11:06 | FromDiscord | <retkid> (edit) "jim-java" => "nim-java" |
03:11:35 | FromDiscord | <treeform> In reply to @Elegantbeef "I dont want a": This good? |
03:11:39 | FromDiscord | <treeform> https://media.discordapp.net/attachments/371759389889003532/878838799906517002/test.png |
03:11:44 | FromDiscord | <Elegantbeef> Yea |
03:11:59 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=3wDl |
03:12:04 | FromDiscord | <treeform> you got to first point in the middel |
03:12:08 | FromDiscord | <treeform> and the other two to the sides |
03:12:25 | FromDiscord | <retkid> holy shit i think i can |
03:13:27 | FromDiscord | <treeform> https://media.discordapp.net/attachments/371759389889003532/878839253600178196/unknown.png |
03:14:30 | FromDiscord | <treeform> In reply to @retkid "holy shit i think": You can already call nim from java, no need to go through Rhino |
03:15:00 | FromDiscord | <retkid> wait really |
03:15:08 | FromDiscord | <retkid> i thought i was told no |
03:15:08 | FromDiscord | <retkid> hm |
03:15:10 | FromDiscord | <Elegantbeef> Ok so the handles are tangent and bitangent basically? |
03:15:50 | FromDiscord | <retkid> i can package nim and run nim in java bytecode? |
03:15:54 | FromDiscord | <Yardanico> no |
03:16:02 | FromDiscord | <treeform> make a regular "c" style dll with nim, use ffi to talk to it. |
03:16:02 | FromDiscord | <treeform> https://github.com/jnr/jnr-ffi |
03:16:05 | nrds | <prestigebot99> itHub: 7"Java Abstracted Foreign Function Layer" |
03:16:06 | FromDiscord | <Yardanico> but you can call native code in any language including nim from java |
03:16:24 | FromDiscord | <Elegantbeef> Anyway thanks treeform makes a bit more sense 😀 |
03:16:39 | FromDiscord | <treeform> In reply to @Elegantbeef "Ok so the handles": Yes |
03:17:01 | FromDiscord | <treeform> For all gradients is center point, up point, and right point. |
03:17:30 | FromDiscord | <Elegantbeef> also you've angered me with having the comment `## Gradient stop position 0..1.` 😀 |
03:17:55 | FromDiscord | <Elegantbeef> Possible PR eventually for `position: 0f..1f` |
03:18:12 | FromDiscord | <treeform> lol |
03:18:23 | FromDiscord | <treeform> You can do a lot with just 3 points: |
03:18:24 | FromDiscord | <treeform> https://media.discordapp.net/attachments/371759389889003532/878840503590862858/unknown.png |
03:18:55 | FromDiscord | <treeform> maybe I would not call them tangent and bitangent... |
03:19:02 | FromDiscord | <Elegantbeef> Why does this look a lot like some internal tooling? |
03:19:13 | FromDiscord | <retkid> why is it doing libc.puts("Hello World) |
03:19:15 | FromDiscord | <retkid> what does that show me |
03:19:19 | FromDiscord | <treeform> That just a screen shot from Figma ... |
03:19:26 | FromDiscord | <Elegantbeef> Ah |
03:19:40 | FromDiscord | <Elegantbeef> A boy could dream 😛 |
03:20:23 | FromDiscord | <treeform> In reply to @retkid "why is it doing": puts is a libc function |
03:20:44 | FromDiscord | <treeform> so in theory it could be `yourlib.yourfunction("stuff")` |
03:21:25 | FromDiscord | <retkid> ah so its jut calling a generic c function |
03:21:30 | FromDiscord | <treeform> yes |
03:21:30 | FromDiscord | <retkid> (edit) "jut" => "just" |
03:21:36 | FromDiscord | <treeform> it could be your nim function |
03:21:37 | FromDiscord | <retkid> very very cool |
03:21:46 | FromDiscord | <treeform> for java-nim inter-op |
03:22:11 | FromDiscord | <retkid> can i nim-java inter-op with wrapper code |
03:22:31 | FromDiscord | <treeform> I have not done it with java but in theory it is possible |
03:23:22 | FromDiscord | <treeform> java is probably most annoying lang to inter-op because they really like keeping everything in java more so then other langs like python, ruby, js and even C#. |
03:23:44 | FromDiscord | <retkid> well\ |
03:23:45 | FromDiscord | <retkid> (edit) "well\" => "well" |
03:23:47 | FromDiscord | <retkid> java is its own JVM |
03:23:54 | FromDiscord | <retkid> special boy pretty pants |
03:24:01 | FromDiscord | <treeform> but every lang has its own lang-vm? |
03:24:23 | FromDiscord | <retkid> yes but java refuses to work outside of javahbyte code and exists in and of itself |
03:24:36 | FromDiscord | <retkid> and its hard to get anything to work inside its margins |
03:24:42 | FromDiscord | <treeform> well refuses... no makes it more annoying that is for sure |
03:29:56 | FromDiscord | <retkid> i suppose i should look into calling java from C to learn how to do it with nim |
03:30:22 | FromDiscord | <retkid> I will finally have an excuse to work with my this language |
03:30:36 | FromDiscord | <retkid> at the cost of making it so other people cannot work on my code lol |
03:53:13 | FromDiscord | <leorize> @retkid\: check out jnim |
03:53:31 | FromDiscord | <leorize> https://github.com/yglukhov/jnim |
03:53:34 | nrds | <prestigebot99> itHub: 7"Nim - Java bridge" |
03:54:07 | FromDiscord | <Yardanico> that's the other way |
03:54:12 | FromDiscord | <Yardanico> nim -> java, not java -> nim |
03:54:17 | FromDiscord | <retkid> you ever think something is so unlikely to exist you dont bother to look it up |
03:54:37 | FromDiscord | <retkid> oh |
03:55:11 | FromDiscord | <retkid> i need nim-java->byte and java-nim-java->byte |
04:01:46 | FromDiscord | <linux user> we can target jvm now?!!! |
04:01:54 | FromDiscord | <linux user> O_O |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:31 | * | supakeen joined #nim |
04:50:42 | * | pch quit (Remote host closed the connection) |
04:52:51 | * | pch joined #nim |
04:56:24 | * | pch quit (Remote host closed the connection) |
04:56:47 | * | pch joined #nim |
05:03:36 | FromDiscord | <Yardanico> In reply to @richard stallmen(crazy GNU guy) "we can target jvm": we can't |
05:03:42 | FromDiscord | <Yardanico> well it depends |
05:20:31 | NimEventer | New thread by Walkre: How to use external packages from the test directory, see https://forum.nim-lang.org/t/8350 |
05:54:54 | FromDiscord | <TechnoRazor> I have hardly any experience with C/C++ compilers and linkers. All I'm trying to do is somehow, in any way, use a C++ library in Nim. I tried including the header file, and I get "undefined reference to..." errors. I tried using the `compile` pragma to compile everything, and I get errors from the g++ compiler. I tried using a precompiled DLL, both with and without linking the lib, and it says the function I'm trying to use isn't decl |
05:56:55 | FromDiscord | <Elegantbeef> Any example of the code you've tried? |
05:58:04 | FromDiscord | <haxscramper> does C++ library itself has any dependendcies? |
05:58:27 | FromDiscord | <haxscramper> what "undefined reference to ..." errors on exactly? |
05:58:45 | FromDiscord | <haxscramper> you might need to `{.passl:-l<C++ dependency>.}` as well |
06:00:39 | FromDiscord | <haxscramper> Also what C++ library are you using? |
06:00:57 | FromDiscord | <TechnoRazor> The library I'm trying to use is Optick: https://github.com/bombomby/optick |
06:01:00 | nrds | <prestigebot99> itHub: 7"C++ Profiler For Games" |
06:03:56 | FromDiscord | <TechnoRazor> sent a code paste, see https://play.nim-lang.org/#ix=3wDG |
06:04:31 | FromDiscord | <haxscramper> what errors do you get exactly? |
06:06:55 | FromDiscord | <TechnoRazor> sent a code paste, see https://paste.rs/zTE |
06:07:20 | FromDiscord | <haxscramper> isn't `OPTICK_FRAME` a macro? |
06:07:30 | FromDiscord | <TechnoRazor> Yes, it is |
06:07:40 | FromDiscord | <haxscramper> then you can't dynlib it by definition |
06:08:06 | FromDiscord | <TechnoRazor> Right, that makes sense, but then how am I expected to use the dll? |
06:09:44 | FromDiscord | <haxscramper> I think you are supposed to wrap macros using importcpp, and wrap procs that it calls using dynlib. I'm not sure what exact combinations is the best here |
06:10:57 | FromDiscord | <haxscramper> it is sad that this library does not have any normal instructions, and instead uses this bs "click here, click there" |
06:11:55 | FromDiscord | <TechnoRazor> In any case, I can't include the header file without all those errors. Am I doing something wrong there? |
06:14:29 | FromDiscord | <haxscramper> when you include header and use macro, it internally expands/calls `Optick::EndFrame(Optick::FrameType::Type, long long, unsigned long long)` method. The method itself is visible through the header, but compiler does not know it's implementation - it was placed somehwere in `.cpp` file that was compiled to static or dynamic library. |
06:15:00 | FromDiscord | <haxscramper> Normally you would be able to fix this by simply `{.passl:"-l<optic_static_library>".}` |
06:15:32 | FromDiscord | <haxscramper> But looking at `CMakeLists.txt` in the Optick repo I don't see that static version is even built |
06:15:51 | * | pro joined #nim |
06:16:17 | FromDiscord | <haxscramper> And there is no standalone example that shows compilation flags either |
06:17:08 | FromDiscord | <TechnoRazor> Should I try building a static library myself? |
06:18:14 | FromDiscord | <haxscramper> This might be a solution, yes, though I'm not sure if that is how this library is supposed to be used |
06:18:35 | FromDiscord | <haxscramper> You can wrap macro manually into template |
06:18:42 | FromDiscord | <haxscramper> And then dynlib things that it calls |
06:19:12 | FromDiscord | <haxscramper> I have never wrapped method from shared library though, so I can't tell how this is supposed to work |
06:23:02 | FromDiscord | <TechnoRazor> I think if you want to include it statically, you're expected to just include the whole source code in your project, which I don't know if I can do in Nim. |
06:24:30 | FromDiscord | <haxscramper> > I tried using the compile pragma to compile everything, and I get errors from the g++ compiler.↵What errors did you get there? |
06:25:35 | FromDiscord | <haxscramper> And no, `Optick::EndFrame(Optick::FrameType::Type, long long, unsigned long long)` is not a method but just a `OPTICK_API uint32_t BeginFrame(Optick::FrameType::Type frameType, int64_t timestamp, uint64_t threadID)` so I think you still can use it normally |
06:26:29 | FromDiscord | <TechnoRazor> I was trying to do something like `{.compile:"optick/.cpp".}` and got `g++.exe: fatal error: cannot specify '-o' with '-c', '-S' or '-E' with multiple files` |
06:26:35 | * | pch quit (Remote host closed the connection) |
06:28:12 | FromDiscord | <TechnoRazor> sent a code paste, see https://play.nim-lang.org/#ix=3wDP |
06:28:29 | FromDiscord | <TechnoRazor> (edit) "https://play.nim-lang.org/#ix=3wDP" => "https://play.nim-lang.org/#ix=3wDQ" |
06:30:22 | FromDiscord | <haxscramper> I can't even built this thing |
06:31:03 | FromDiscord | <TechnoRazor> They have some sort of guide for building it yourself: https://github.com/bombomby/optick/wiki/How-to-start?-(Programmers-Setup) |
06:31:03 | FromDiscord | <haxscramper> Using build instructions from the repo |
06:46:42 | NimEventer | New thread by Chat_noir: [newbie] Question about downloading image files programming, see https://forum.nim-lang.org/t/8351 |
06:53:55 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wDR |
06:54:02 | FromDiscord | <haxscramper> I've confirmed that function is implemented in the .so |
06:54:21 | FromDiscord | <haxscramper> With mangled (?) name `Optick::BeginFrame_Optick::FrameType::Typelongunsigned_long_` and demangled `Optick::Core::BeginUpdateFrame(Optick::FrameType::Type, long, unsigned long)` |
06:54:31 | FromDiscord | <haxscramper> but I don't know how to correctly importc this |
06:54:45 | FromDiscord | <haxscramper> `importc: "Optick::Core::BeginUpdateFrame(Optick::FrameType::Type, long, unsigned long)"` or `imporc: "Optick::BeginFrame_Optick::FrameType::Typelongunsigned_long_"` has failed |
06:55:14 | FromDiscord | <haxscramper> So I suggest you make a forum post about this, since surely someone has already done this |
06:55:17 | FromDiscord | <haxscramper> @TechnoRazor\: |
06:56:43 | * | jjido joined #nim |
06:58:03 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wDT |
06:58:56 | FromDiscord | <haxscramper> Compile implementation using `gcc name.cpp -fpic -shared -oliblibname.so` |
07:01:05 | FromDiscord | <TechnoRazor> I'm not sure if I even understand the problem, so I wouldn't know how to ask about this |
07:03:35 | FromDiscord | <haxscramper> well, I'm interested too, so I can make a post |
07:03:45 | FromDiscord | <TechnoRazor> Thanks |
07:13:39 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wDY |
07:13:49 | FromDiscord | <haxscramper> but this is just hell |
07:17:20 | FromDiscord | <haxscramper> well, this is "nevermind I figured it out" moment before I even asked the question |
07:23:30 | * | max22- joined #nim |
07:28:32 | FromDiscord | <haxscramper> https://forum.nim-lang.org/t/8352#53847 |
07:28:46 | NimEventer | New thread by Haxscramper: Interfacing with C++ shared library that uses macros, see https://forum.nim-lang.org/t/8352 |
07:58:50 | FromDiscord | <Cark> is there a way to see which underlying c compiler is used by my nim install ? like interrogating nim.exe about it ? |
08:00:19 | FromDiscord | <Cark> (edit) "interrogating" => "asking" |
08:03:35 | FromDiscord | <haxscramper> nim defaults to gcc, also you can compile with `--verbosity:3 --hint[CC]:on` IIRC it would show all compiler calls |
08:04:36 | FromDiscord | <Cark> thanks ! |
08:16:31 | * | pro quit (Quit: WeeChat 3.2) |
08:17:52 | * | pro joined #nim |
08:23:22 | FromDiscord | <Ondrejoda> sent a long message, see http://ix.io/3wEc |
08:23:28 | FromDiscord | <Ondrejoda> so yeah |
08:23:33 | FromDiscord | <Ondrejoda> i'll be using nim now |
08:23:34 | FromDiscord | <Elegantbeef> Welcome \:D |
08:23:40 | FromDiscord | <impbox [ftsf]> aye =) |
08:23:55 | FromDiscord | <impbox [ftsf]> not sure if it's perfect, but it's the best thing i've found |
08:31:24 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:36:35 | FromDiscord | <Rika> Depending on what you think is complicated ehem Nim is complicated |
08:38:14 | madprops | nim has cubed vim! https://github.com/oakes/vim_cubed |
08:38:17 | nrds | <prestigebot99> itHub: 7"Vim rendered on a cube for no reason" |
08:41:50 | madprops | I still don't understand how much can be done natively without using c libraries/wrappers |
08:42:45 | FromDiscord | <haxscramper> it uses opengl |
08:43:17 | FromDiscord | <impbox [ftsf]> natively? |
08:43:55 | FromDiscord | <impbox [ftsf]> not much can be done "natively" in c without using a c library |
08:44:00 | madprops | I mean, a lot of stuff seem to require wrappers |
08:44:07 | madprops | qt, ncurses .. |
08:44:14 | madprops | im guessing xorg interfacing too |
08:44:32 | FromDiscord | <impbox [ftsf]> well it makes sense to reuse that existing work rather than recode everything |
08:44:38 | madprops | yeah that's true |
08:44:46 | FromDiscord | <impbox [ftsf]> that's one of the advantages of nim, it can easily interface with existing c libraries |
08:44:54 | FromDiscord | <impbox [ftsf]> but you could recode it all in nim if you really wanted to |
08:44:58 | FromDiscord | <impbox [ftsf]> but it would be a lot of work |
08:45:12 | madprops | like recoding libc |
08:45:17 | FromDiscord | <impbox [ftsf]> yep |
08:45:26 | FromDiscord | <Rika> What is “native” anyway? |
08:45:43 | FromDiscord | <Rika> You can make a wrapper feel completely native |
08:47:07 | madprops | but is something lost along the way? |
08:47:16 | madprops | can qt applications be done perfectly with nim? |
08:48:04 | madprops | I remember that being a requested feature |
08:48:19 | madprops | requested library |
08:48:20 | FromDiscord | <impbox [ftsf]> i haven't tried, i don't see why not? |
08:48:42 | FromDiscord | <impbox [ftsf]> though QT is c++, so you'd probably want to output c++ instead of c |
08:48:48 | FromDiscord | <haxscramper> not "perfectly", but you can easily import qt classes |
08:48:49 | FromDiscord | <haxscramper> but then you |
08:48:49 | FromDiscord | <haxscramper> well |
08:48:50 | FromDiscord | <haxscramper> you can't derive from C++ classes |
08:48:50 | FromDiscord | <haxscramper> at least not easily |
08:48:52 | FromDiscord | <haxscramper> I have tried and there are some roablocks |
08:49:04 | FromDiscord | <impbox [ftsf]> C++ is troublesome for libraries |
08:51:11 | FromDiscord | <haxscramper> `nim r --backend:cpp qhello.nim` |
08:51:13 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wEf |
08:52:45 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/PWy |
08:52:53 | * | pro quit (Quit: WeeChat 3.2) |
09:31:09 | FromDiscord | <PressF> Hey.↵Does anyone have a good resource explaining {.importc.} {.constructor.} and other stuff like that (pragas is what they are called right?) |
09:32:04 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html can help you, it lists most pragmas that are available by default |
09:32:32 | FromDiscord | <Yardanico> specifically https://nim-lang.org/docs/manual.html#pragmas and https://nim-lang.org/docs/manual.html#implementation-specific-pragmas |
09:34:33 | FromDiscord | <PressF> In reply to @Yardanico "https://nim-lang.org/docs/manual.html can help you,": Thx. Ill add that to the reading list. |
09:42:05 | FromDiscord | <Neko~Neko~ni> Hello!.nim in apt package manager is not being updated is there a reason for that. |
09:43:20 | FromDiscord | <Rika> Probably |
09:43:28 | FromDiscord | <Neko~Neko~ni> (edit) "updated" => "updated." |
09:43:53 | FromDiscord | <Rika> It is probably due to Ubuntu/Debian being a “stability over cutting edge” distro |
09:44:05 | FromDiscord | <Neko~Neko~ni> i installed nim from apt package manager but it installed a really old version |
09:44:21 | FromDiscord | <PsychoClay> u can use choosenim |
09:44:36 | FromDiscord | <Neko~Neko~ni> yeah after which i installed from choosenim |
09:46:24 | FromDiscord | <Neko~Neko~ni> installing nim from tarballs ,also had a problem.like nim was installed but nimble wasn't.i also checked the $PATH .doesn't the install.sh script adds the dir containing nimble to $PATH. |
10:07:34 | FromDiscord | <Ondrejoda> i got a question |
10:07:44 | FromDiscord | <Ondrejoda> can you compile a .exe file on linux |
10:07:47 | FromDiscord | <Ondrejoda> (edit) "linux" => "linux?" |
10:08:01 | FromDiscord | <Ondrejoda> by that i guess i mean cross-compiling |
10:09:18 | FromDiscord | <Ondrejoda> just found out <https://nim-lang.org/docs/nimc.html#crossminuscompilation-for-windows> |
10:17:03 | FromDiscord | <impbox [ftsf]> you can |
10:17:39 | * | beshr joined #nim |
10:31:39 | * | xet7 quit (Remote host closed the connection) |
10:32:39 | * | xet7 joined #nim |
10:51:52 | NimEventer | New thread by Rforcen: Heap mgr improved?, see https://forum.nim-lang.org/t/8353 |
11:01:40 | * | max22- quit (Ping timeout: 250 seconds) |
11:06:13 | FromDiscord | <Bren> What release is the http-client for js planned to be in? |
11:06:26 | FromDiscord | <Ondrejoda> how can i turn `1..100` into a seq? |
11:06:51 | FromDiscord | <haxscramper> `toSeq(1..100)` from |
11:06:56 | FromDiscord | <haxscramper> `toSeq` is from `std/sequtils` |
11:07:05 | FromDiscord | <Ondrejoda> oh |
11:11:14 | FromDiscord | <konsumlamm> In reply to @Bren "What release is the": it will be in https://github.com/nim-lang/standardjs |
11:11:16 | nrds | <prestigebot99> itHub: 7"Wrappers for standardized JS modules." |
11:12:21 | nrds | <sorcerer99> accident sorry lmao, meant to set that as my usermode |
11:13:50 | * | [R] joined #nim |
11:26:57 | * | pch joined #nim |
11:42:02 | FromDiscord | <dauuricus (haywhnk)> hello |
11:43:09 | FromDiscord | <dauuricus (haywhnk)> I need to know how to write `image file download` code in nimlang |
11:43:42 | FromDiscord | <dauuricus (haywhnk)> can i ask it here? |
11:44:02 | FromDiscord | <PsychoClay> try `httpclient.downloadFile` |
11:44:11 | FromDiscord | <dauuricus (haywhnk)> ok |
11:44:18 | FromDiscord | <dauuricus (haywhnk)> https://forum.nim-lang.org/t/8351 |
11:45:25 | FromDiscord | <dauuricus (haywhnk)> i want to download image file over `403 fobidden error` ... |
11:46:10 | FromDiscord | <PsychoClay> then you might need to set some headers |
11:49:34 | FromDiscord | <dauuricus (haywhnk)> IS THERE some document about the setting up httpclient ? |
11:49:56 | FromDiscord | <PsychoClay> https://nim-lang.org/docs/httpclient.html |
11:51:58 | FromDiscord | <dauuricus (haywhnk)> uuh |
11:54:00 | FromDiscord | <dauuricus (haywhnk)> i can't understand how to set and i don't know where is problem in get method in nim |
11:54:16 | FromDiscord | <PsychoClay> show code |
11:58:48 | FromDiscord | <dauuricus (haywhnk)> sent a code paste, see https://play.nim-lang.org/#ix=3wEK |
12:01:07 | FromDiscord | <dauuricus (haywhnk)> or |
12:01:40 | FromDiscord | <dauuricus (haywhnk)> var res = client.get(url) |
12:01:51 | FromDiscord | <PsychoClay> yea u cant download a file if the server returns a 403 |
12:01:52 | FromDiscord | <dauuricus (haywhnk)> echo res.body |
12:02:05 | FromDiscord | <dauuricus (haywhnk)> yes |
12:02:45 | FromDiscord | <dauuricus (haywhnk)> sent a code paste, see https://play.nim-lang.org/#ix= |
12:03:00 | FromDiscord | <dauuricus (haywhnk)> \`\`\`\`\`\` |
12:04:35 | FromDiscord | <dauuricus (haywhnk)> in case Python |
12:04:48 | FromDiscord | <dauuricus (haywhnk)> sent a code paste, see https://play.nim-lang.org/#ix= |
12:05:18 | FromDiscord | <dauuricus (haywhnk)> sent a code paste, see https://play.nim-lang.org/#ix=3wEM |
12:05:55 | FromDiscord | <dauuricus (haywhnk)> I need binary res.body ... |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:31 | * | supakeen joined #nim |
12:07:44 | FromDiscord | <PsychoClay> dude u cant download a file if the server returns 403, it wont work |
12:08:36 | FromDiscord | <dauuricus (haywhnk)> In python request case\: no |
12:09:44 | FromDiscord | <dauuricus (haywhnk)> i can get the jpg file binary to local file |
12:09:53 | FromDiscord | <dauuricus (haywhnk)> Over 403 |
12:10:20 | FromDiscord | <PsychoClay> i doubt that |
12:11:31 | FromDiscord | <dauuricus (haywhnk)> res.content == binary |
12:11:52 | FromDiscord | <dauuricus (haywhnk)> in requests(python) |
12:12:16 | FromDiscord | <PsychoClay> ur request example just puts the error html page into a jpg file |
12:12:45 | FromDiscord | <dauuricus (haywhnk)> yes,yes |
12:14:21 | FromDiscord | <fae> huh, Nim forum confirmation email went to my spam 😬 |
12:14:25 | FromDiscord | <dauuricus (haywhnk)> sent a code paste, see https://paste.rs/hBu |
12:14:28 | FromDiscord | <dauuricus (haywhnk)> ruby case |
12:14:45 | FromDiscord | <Rika> run the code now |
12:14:48 | FromDiscord | <Rika> does it work now? |
12:14:55 | FromDiscord | <Rika> the python/ruby code i mean |
12:16:11 | FromDiscord | <dauuricus (haywhnk)> I want to know how to do the same effect in nim... |
12:16:21 | FromDiscord | <dauuricus (haywhnk)> https://forum.nim-lang.org/t/8351 |
12:16:29 | FromDiscord | <Rika> no, run the same code in python now |
12:16:31 | FromDiscord | <Rika> does it still work |
12:16:37 | FromDiscord | <Rika> try it |
12:16:43 | FromDiscord | <Rika> now, not before |
12:18:46 | FromDiscord | <Rika> i'll help you further if you can verify that the python code still works now |
12:18:55 | FromDiscord | <haxscramper> > AttributeError\: 'list' object has no attribute 'len'↵Pain of having to write python after nim is just |
12:19:01 | FromDiscord | <haxscramper> absolutely unbearable |
12:19:24 | * | flynn quit (Read error: Connection reset by peer) |
12:20:32 | * | flynn joined #nim |
12:30:28 | FromDiscord | <dauuricus (haywhnk)> sorry i understand |
12:31:34 | FromDiscord | <dauuricus (haywhnk)> yes that python code is not working |
12:31:48 | FromDiscord | <dauuricus (haywhnk)> yes i understand |
12:31:54 | FromDiscord | <Rika> okay |
12:32:28 | FromDiscord | <dauuricus (haywhnk)> it was block by area region |
12:32:40 | FromDiscord | <dauuricus (haywhnk)> now i understand |
12:34:01 | FromDiscord | <dauuricus (haywhnk)> i did both code in googlecolab == not working 403 |
12:34:39 | FromDiscord | <dauuricus (haywhnk)> but in local termux case works |
12:35:02 | FromDiscord | <dauuricus (haywhnk)> so its not 403,it was 200 |
12:35:14 | FromDiscord | <Rika> i see |
12:35:17 | FromDiscord | <dauuricus (haywhnk)> yes thanks. |
12:35:26 | FromDiscord | <Rika> that is strange |
12:35:35 | FromDiscord | <Rika> i thought it was an expired link |
12:35:49 | FromDiscord | <dauuricus (haywhnk)> but i canot use local termux nim |
12:36:27 | FromDiscord | <dauuricus (haywhnk)> so i didnt test in local nim code |
12:36:45 | FromDiscord | <Rika> i see |
12:37:06 | FromDiscord | <dauuricus (haywhnk)> it maybe fixed termux nim compiler yesterday.. |
12:37:40 | FromDiscord | <dauuricus (haywhnk)> https://forum.nim-lang.org/t/8345 |
12:38:50 | FromDiscord | <dauuricus (haywhnk)> i will try when termux\`s pkg has updeted |
12:44:32 | FromDiscord | <dauuricus (haywhnk)> thanks. |
12:46:01 | FromDiscord | <krisppurg> Is there in any way to change my nim to something `[Windows: amd64]`, because when I do install from choosenim, it always installs nim with `[Windows: i386]` which is pretty slow for compiling code.↵(If you are confused, I got this information from `nim -v`) |
12:46:28 | FromDiscord | <krisppurg> (edit) "amd64]`," => "amd64]`?" |
12:53:16 | FromDiscord | <Yardanico> you can install Nim on windows yourself instead of choosenim |
12:53:37 | FromDiscord | <Yardanico> just add mingw to path (choosenim already did that) and build_all.bat |
12:53:43 | FromDiscord | <Yardanico> then add the bin folder to PATH |
12:55:48 | FromDiscord | <Yardanico> Also changing from nim i386 to amd64 won't really make the compilation much faster |
13:00:33 | FromDiscord | <dom96> In reply to @krisppurg "Is there in any": yeah, doubt amd64 will improve speed |
13:00:50 | FromDiscord | <dom96> but choosenim will install amd64 as long as you don't have an i386 gcc in your PATH |
13:01:00 | FromDiscord | <dom96> also, make sure you've got the newest choosenim |
13:05:47 | * | max22- joined #nim |
13:06:18 | FromDiscord | <krisppurg> In reply to @dom96 "also, make sure you've": I can just update choosenim through nimble , right |
13:09:51 | * | arkurious joined #nim |
13:33:06 | FromDiscord | <konsumlamm> you can update choosenim through itself |
13:33:22 | FromDiscord | <konsumlamm> `choosenim update self` |
13:40:22 | * | pro joined #nim |
13:41:44 | FromDiscord | <Ondrejoda> how can i covert a float to a uint8? i tried `toU8(toInt(my_float_num))` but that doesn't work |
13:42:01 | FromDiscord | <impbox [ftsf]> myFloat.uint8 |
13:43:31 | FromDiscord | <impbox [ftsf]> or you can do it c style `(uint8)myFloat` |
13:44:03 | FromDiscord | <impbox [ftsf]> or `uint8(myFloat)` |
13:44:05 | FromDiscord | <impbox [ftsf]> lots of options |
13:45:53 | FromDiscord | <Ondrejoda> In reply to @impbox "myFloat.uint8": hey, that worked! thanks |
13:46:15 | FromDiscord | <impbox [ftsf]> note that it works a bit differently to `toInt` in how it's rounded |
13:46:51 | FromDiscord | <impbox [ftsf]> if you want the same rounding as toInt you can do `myFloat.toInt.uint8` |
13:48:04 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3wFc |
13:56:48 | FromDiscord | <dankrad> after updating a pull request, do i need to ping someone/write something or do i just need to wait? |
13:58:05 | FromDiscord | <xflywind> link? |
13:58:38 | FromDiscord | <dankrad> https://github.com/nim-lang/Nim/pull/18727 |
13:59:19 | FromDiscord | <dankrad> because I've a second pr ready, it fixes 14511, but I need to wait for the other to be merged |
13:59:40 | FromDiscord | <xflywind> I think araq will review it. |
13:59:57 | FromDiscord | <dankrad> ok |
14:03:06 | NimEventer | New Nimble package! composition - Composition pattern with event handling library in Nim, see https://github.com/DavidMeagher1/composition |
14:03:09 | nrds | <prestigebot99> itHub: 7"Composition pattern with event handling module in Nim" |
14:08:59 | FromDiscord | <haxscramper> sent a long message, see http://ix.io/3wFk |
14:09:50 | FromDiscord | <Rika> that would be nice |
14:09:58 | FromDiscord | <Rika> im pretty sure some langs have such a tool |
14:10:09 | FromDiscord | <Rika> code quality tools i think is what theyre called |
14:30:25 | * | audiophile_ joined #nim |
14:31:17 | * | audiophile_ quit (Client Quit) |
14:35:04 | FromDiscord | <dom96> In reply to @krisppurg "I can just update": no, update through choosenim |
14:35:13 | FromDiscord | <dom96> I think I will just remove choosenim from Nimble |
14:36:39 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wFp |
14:36:51 | FromDiscord | <haxscramper> well, not as bad as I imagined |
14:37:01 | FromDiscord | <haxscramper> That excludes `"bluu", "netwatch", "gcplat", "atoz", "compiler", "finalseg"` |
14:37:24 | FromDiscord | <haxscramper> because these are 1m+ auto-codegened packages |
14:37:40 | FromDiscord | <haxscramper> or will skew test number very much |
14:38:45 | * | max22- quit (Quit: Leaving) |
15:19:03 | FromDiscord | <fae> One of the coolest features I’ve seen in a package manager is Elms automatic semver checking on publish. Looks at public api and forces breaking changes if necessary. |
15:20:27 | FromDiscord | <fae> Granted it’s easier to do with a centralized host |
15:20:49 | FromDiscord | <Rika> how does it cope when behavior changes |
15:20:57 | FromDiscord | <Rika> and nothing from the public api? |
15:21:08 | FromDiscord | <Rika> (edit) "and nothing from the ... public" added "surface of the" |
15:21:31 | FromDiscord | <fae> Just looks at the api |
15:21:52 | FromDiscord | <fae> But considering it’s a pure language behavior is pretty transparent |
15:22:15 | FromDiscord | <Rika> what would constitute a minor change over a major one |
15:22:20 | FromDiscord | <Rika> and a patch |
15:22:30 | FromDiscord | <Rika> actually i assume this is specced in elm's repos or something no |
15:22:32 | FromDiscord | <Rika> ill see |
15:22:51 | * | pro quit (Quit: WeeChat 3.2) |
15:24:17 | FromDiscord | <Rika> i assume this would be very difficult in nim due to the strong metaprogramming |
15:25:00 | FromDiscord | <Rika> actually perhaps not, unless the output of someones macro changed depending on the time, in which case they are insane |
15:25:17 | FromDiscord | <Rika> i remember this being discussed before though |
15:25:34 | FromDiscord | <haxscramper> In reply to @Rika "how does it cope": it is possible to implement, just hard |
15:25:39 | FromDiscord | <haxscramper> but this can be done |
15:25:42 | FromDiscord | <Rika> i understand yes |
15:25:44 | FromDiscord | <Rika> i can see it |
15:25:46 | FromDiscord | <haxscramper> AST diffing, semantic diffing etc |
15:25:46 | FromDiscord | <fae> Yea I have no idea, was just musing. It was always a feature that impressed me, static types ftw |
15:26:36 | FromDiscord | <Rika> In reply to @haxscramper "AST diffing, semantic diffing": yes i see, this seems like it is in the realm of "practically doable" |
15:26:54 | FromDiscord | <haxscramper> I had POC for haxdoc that can tell you as much https://media.discordapp.net/attachments/371759389889003532/879023830146891816/rMqkcDUbdqaAJNUQENfHKmtK.png |
15:26:58 | FromDiscord | <haxscramper> AST diffing is |
15:27:04 | FromDiscord | <haxscramper> well, I have it done too, but not in usable form |
15:27:26 | FromDiscord | <haxscramper> complete ast diffing is NP hard (with moves) |
15:27:38 | FromDiscord | <Rika> wait, really? why? |
15:28:04 | FromDiscord | <haxscramper> I don't remember exact paper that links to the proof, but the whole problem is in moves |
15:28:26 | FromDiscord | <Rika> moves are defined as |
15:28:44 | FromDiscord | <haxscramper> move one part of subtree into any other part of subtree |
15:29:11 | FromDiscord | <Rika> okay |
15:29:58 | FromDiscord | <haxscramper> and algorithms that deal with this stuff look like horrible nest of heursitcs that makes zero sense whatsoever |
15:30:09 | FromDiscord | <haxscramper> but thanfylly someone rewrote it in java, and I rewrote it in nim |
15:30:20 | FromDiscord | <haxscramper> still don't understand 80% of ti |
15:30:57 | FromDiscord | <haxscramper> basically main issue with AST diffing is to get sensible output |
15:31:12 | FromDiscord | <haxscramper> there is no shortage of tools to copy btw |
15:31:25 | FromDiscord | <haxscramper> about a month ago HN had tons of links |
15:31:35 | FromDiscord | <Rika> im looking at https://www.monperrus.net/martin/tree-differencing |
15:31:41 | FromDiscord | <Rika> looks old though |
15:31:50 | FromDiscord | <haxscramper> I used https://github.com/GumTreeDiff/gumtree/ |
15:31:53 | nrds | <prestigebot99> itHub: 7"A neat code differencing tool" |
15:32:04 | FromDiscord | <haxscramper> they have reference implementation for lots of alogs |
15:32:04 | FromDiscord | <Rika> yes the link i sent recommends gumtree first |
15:32:18 | FromDiscord | <haxscramper> yes, and it the best one I've seen in terms of |
15:32:23 | FromDiscord | <Rika> are the algos commented ^^; |
15:32:28 | FromDiscord | <haxscramper> "can copy implementatin" |
15:32:37 | FromDiscord | <haxscramper> In reply to @Rika "are the algos commented": no |
15:32:58 | FromDiscord | <Rika> which folder did you read |
15:33:21 | FromDiscord | <haxscramper> and as I said, they implemented as please-kill-me code style https://github.com/GumTreeDiff/gumtree/blob/dc3cbd3d412ec8f2bd2afb78de329b04884c0e74/core/src/main/java/com/github/gumtreediff/matchers/optimal/rted/RtedAlgorithm.java#L452 |
15:33:26 | FromDiscord | <haxscramper> I've read the paper |
15:33:27 | FromDiscord | <haxscramper> well, tried |
15:33:42 | FromDiscord | <Rika> oh goodness |
15:33:55 | FromDiscord | <haxscramper> I just wrote java -> nim transpiler and fixed compilation errors |
15:34:05 | FromDiscord | <haxscramper> thankfully enough nim is very close to java |
15:35:04 | FromDiscord | <Rika> i feel like ive seen this algorithm before |
15:35:58 | FromDiscord | <haxscramper> RTED? |
15:36:48 | FromDiscord | <haxscramper> gumtree final algorithm is a composition of seveal subalgorithms total, some of them simple (lcs of dfs subnode arrangement) |
15:36:49 | FromDiscord | <Rika> yeah i thought it was that |
15:36:58 | FromDiscord | <haxscramper> some of them pretty complex |
15:37:14 | FromDiscord | <haxscramper> but they just compute mapping between two trees and then I feed things into edit script generator |
15:37:19 | FromDiscord | <haxscramper> script generator is pretty easy |
15:37:48 | FromDiscord | <haxscramper> so it can process any mappings constructed in any (reasonable) form |
15:38:14 | FromDiscord | <haxscramper> and yes my impl is https://github.com/haxscramper/hmisc/tree/f0645f534184dae9dff3ee84ce0f022e58e84e8e/src/hmisc/extra/treediff |
15:38:26 | FromDiscord | <Rika> im sorry i have to go its late for me ;; |
15:38:31 | FromDiscord | <Rika> this is mind melting though |
15:38:55 | FromDiscord | <haxscramper> some guy on hn said he spent like ~10 years on something like that |
15:40:26 | * | max22- joined #nim |
15:44:06 | * | max22- quit (Client Quit) |
15:45:18 | * | Gustavo6046 joined #nim |
15:45:23 | Gustavo6046 | Hello :) |
16:41:20 | FromDiscord | <rishavs (Rishav Sharan)> Has anyone written a lexer/parser in nim? I am interested in seeing how I can repesent a simple grammar using nim types |
16:43:20 | FromDiscord | <dom96> sure, this is pretty old but could still be useful https://github.com/dom96/nael/ |
16:43:22 | nrds | <prestigebot99> itHub: 7"Stack-based language similar to Factor." |
16:44:28 | FromDiscord | <haxscramper> https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6 |
16:49:10 | FromDiscord | <rishavs (Rishav Sharan)> Thanks!↵(@dom96) |
16:53:20 | * | nrds quit (Remote host closed the connection) |
16:53:51 | * | nrds joined #nim |
16:56:54 | FromDiscord | <gerwy> Its not really Nim related but do you think that book about optimization from 1994 is still useful? Like i don't think they had vectorization or multithreading |
16:59:35 | FromDiscord | <gerwy> Even better↵For you to imagine how long ago it was it was year after release of first Doom and two years before Duke Nukem 3D |
17:01:17 | FromDiscord | <gerwy> And two years before dom being born i guess hah |
17:06:29 | FromDiscord | <noxabellus> howdy yall✌️day 1 in nim here |
17:07:48 | FromDiscord | <noxabellus> was wondering if theres some way to access a seq without throwing an exception if my index is out of bounds. like, in rust i can get an option value with the `get` method. is there any way to do that, or will i have to make a try/except wrapper? |
17:08:42 | FromDiscord | <noxabellus> the docs im finding dont really cover built ins such as seq's [] very well |
17:09:28 | FromDiscord | <konsumlamm> there's no version that returns an `Option[T]` in the stdlib |
17:20:34 | FromDiscord | <exelotl> Hey! |
17:21:12 | FromDiscord | <exelotl> yeah I think you'll have to write your own helper for that |
17:22:10 | FromDiscord | <noxabellus> sent a code paste, see https://play.nim-lang.org/#ix=3wGe |
17:22:18 | FromDiscord | <leorize> please don't catch the Defect produced by an out of bounds array access, use `.len` instead↵(@noxabellus) |
17:22:25 | FromDiscord | <noxabellus> interesting |
17:22:26 | FromDiscord | <noxabellus> ok |
17:22:57 | FromDiscord | <exelotl> you could probably use `openArray` instead of making a concept for this |
17:23:18 | FromDiscord | <leorize> openArray doesn't work when you need the index type |
17:23:24 | FromDiscord | <noxabellus> why is it not okay to use try/except here? |
17:23:29 | FromDiscord | <noxabellus> more overhead? |
17:23:30 | FromDiscord | <leorize> ie. an array with enum for index |
17:24:04 | FromDiscord | <exelotl> out of bounds accesses raise a "defect" which is not supposed to be catchable |
17:24:13 | FromDiscord | <leorize> Defect is meant to signify a programming error and in the future will crash your program immediately |
17:24:13 | FromDiscord | <noxabellus> ohh |
17:24:24 | FromDiscord | <noxabellus> well thats good to know lol |
17:24:50 | FromDiscord | <leorize> currently it doesn't do that because there are a lot of people who catch them, but things might change by the time nim 2.0 is out |
17:25:12 | FromDiscord | <noxabellus> fair enough |
17:28:16 | FromDiscord | <noxabellus> so, i just wrote `index < s.len` and it compiled fine which was sort of surprising to me |
17:29:29 | FromDiscord | <noxabellus> this is more like c++ templates than it is generics, i suppose? |
17:29:43 | FromDiscord | <exelotl> ah, you were expecting it to fail because it's not listed in the concept? |
17:29:47 | FromDiscord | <noxabellus> right |
17:30:18 | FromDiscord | <exelotl> yeah they are more like templates I think |
17:33:54 | * | perro quit (Quit: WeeChat 3.2) |
17:36:13 | FromDiscord | <haxscramper> I hope defect will be simply removed in 2.0 |
17:48:58 | FromDiscord | <⃟⃟> what is the purpose of defect? |
17:51:59 | FromDiscord | <haxscramper> To show that you know what errors library user should and should not handle, do better than themselves |
17:52:19 | FromDiscord | <haxscramper> But in reality it does not work, and can not work |
17:52:24 | FromDiscord | <haxscramper> (edit) "can not" => "cannot" |
17:52:54 | FromDiscord | <haxscramper> (edit) removed "do better than themselves" |
17:53:33 | FromDiscord | <haxscramper> Basically create pain in the ass for no reason |
17:55:29 | FromDiscord | <haxscramper> Well, at least I don't remember anyone praising defect, and I've seen a lot of coplaints about it's counter-intuitiveness, the fact that it "can but should not" be caught |
17:55:48 | FromDiscord | <haxscramper> special language dialects where `--pandics:on` now changes semantics of the code |
17:56:54 | FromDiscord | <haxscramper> You can't test for defects really (because you have to catch them, and that's exactly what you are "not supposed" to do) |
18:03:01 | FromDiscord | <Ondrejoda> is there something like python |
18:03:15 | FromDiscord | <Ondrejoda> is there something like python's turtle in python? |
18:03:20 | FromDiscord | <Ondrejoda> nim |
18:03:26 | FromDiscord | <Ondrejoda> what is wrong with me |
18:03:41 | FromDiscord | <Ondrejoda> (edit) "python?" => "nim?" |
18:04:54 | * | perro joined #nim |
18:11:53 | emery | is `shr` supposed to work like this `(1'u64 shr 64) == 1`? |
18:29:19 | FromDiscord | <exelotl> no, that would be a bit rotate rather than a bit shift |
18:35:28 | FromDiscord | <konsumlamm> sent a code paste, see https://play.nim-lang.org/#ix=3wGw |
18:35:49 | FromDiscord | <noxabellus> :brainpower: holy crap |
18:36:01 | FromDiscord | <noxabellus> thank you |
18:39:34 | emery | exelotl: that is what it does https://play.nim-lang.org/#ix=3wGx |
18:41:44 | FromDiscord | <exelotl> emery: ohh it's UB |
18:42:04 | FromDiscord | <exelotl> https://stackoverflow.com/a/52784557 |
18:44:52 | emery | heh, its not nim's fault then |
18:45:51 | FromDiscord | <exelotl> I'm surprised there's no warnings output during compilation though |
18:47:09 | emery | different compiler comunities have different assumptions about what people should know is UB? |
18:52:14 | * | max22- joined #nim |
19:05:56 | FromDiscord | <Neko~Neko~ni> Does anyone know pythons requests module in nim.↵i mean a HTTP module like pythons request,httpx ? |
19:14:45 | FromDiscord | <treeform> In reply to @Life Sucks "Its not really Nim": I think that pretty much all algorithmic optimizations from 1994 are still useful. Huge difference between big O of N, log N, N^2, N! ... true for all computers. |
19:15:15 | FromDiscord | <treeform> People in 1994 had to always optimize |
19:15:26 | FromDiscord | <treeform> it was not like its now were we can just meh it and computers are still fast |
19:15:37 | FromDiscord | <gerwy> i know, its just i was concerned about the technology used in those years vs what we use now |
19:15:57 | FromDiscord | <gerwy> but knowing algorithms is always a good idea i guess |
19:16:37 | FromDiscord | <gerwy> but remember that this was made far before inventing Fast Inevrse Square Root |
19:16:44 | FromDiscord | <gerwy> (edit) "Inevrse" => "Inverse" |
19:18:06 | FromDiscord | <treeform> Carmack's Fast Inverse Square Root is pretty fun intellectual thing, but its not like its solves all optimization problems. I don't know if people still use it even, I don.t |
19:18:08 | FromDiscord | <treeform> (edit) "don.t" => "dont." |
19:18:41 | FromDiscord | <treeform> its only useful for numbers that are closer to 1 |
19:19:01 | FromDiscord | <treeform> so only good for like normals and lighting calculations |
19:19:08 | FromDiscord | <treeform> so GPUs just do the real sqrt in its place now |
19:19:25 | FromDiscord | <gerwy> yeah its very smart imo, but thats the point, it was needed then because of the limitations, but now, its a lot slower than native inverse square roots instructions that pc does or for example made for C |
19:19:36 | FromDiscord | <gerwy> and its not precise too |
19:23:27 | FromDiscord | <treeform> I remember reading how it was faster to use lookup tables for sine rather then use the CPU's sine function. Back then memory speed propitiation to cpu seed was way different. |
19:23:43 | FromDiscord | <treeform> Now days memory is a lot slower compared to cpu. |
19:24:15 | FromDiscord | <treeform> This is what also made linked lists more viable on older hardware |
19:24:24 | FromDiscord | <treeform> now days linked lists are pretty much always a bad idea |
19:30:07 | FromDiscord | <treeform> Networking and servers was very slow, so algorithms like lock step and peer to peer was more popular. |
19:30:38 | FromDiscord | <treeform> Now most online games use company servers and predictions instead. |
19:32:13 | FromDiscord | <noxabellus> is there like a bottom/never type or some other thing i can use to make a hole in an expression? |
19:32:32 | FromDiscord | <haxscramper> `void`? |
19:32:42 | FromDiscord | <treeform> how would you use it? |
19:32:47 | FromDiscord | <konsumlamm> nah, `void` isn't a bottom type |
19:32:55 | FromDiscord | <konsumlamm> In reply to @noxabellus "is there like a": there is none in the stdlib |
19:33:02 | FromDiscord | <noxabellus> like in rust i can do `todo!()` or `unreachable!()` |
19:33:12 | FromDiscord | <konsumlamm> (as in no such type, not a type called `none`...) |
19:33:20 | FromDiscord | <haxscramper> well, `{.noreturn.}` for proc then |
19:33:28 | FromDiscord | <konsumlamm> oh, right, that exists |
19:33:34 | FromDiscord | <haxscramper> At least that might be `unreachable!()` |
19:33:44 | FromDiscord | <treeform> I just do `quit("not supposed to be here")` |
19:34:28 | FromDiscord | <haxscramper> `raise newImplementError()` |
19:34:55 | FromDiscord | <noxabellus> raise is an expression? |
19:35:06 | FromDiscord | <haxscramper> raise is a noreturn statement |
19:35:46 | FromDiscord | <haxscramper> you can use any noreturn statement in `if/case` expressions |
19:36:12 | FromDiscord | <noxabellus> oh okay |
20:00:16 | FromDiscord | <dom96> `discard`? |
20:04:17 | FromDiscord | <konsumlamm> `dicard` just discards the result, the point of a "bottom type" is that it never returns (normally) |
20:04:31 | FromDiscord | <Ayy Lmao> Has anyone messed around with doing 2d vector graphics in opengl? I'm looking for resources or advice to learn about that sort of thing. |
20:04:53 | FromDiscord | <konsumlamm> In reply to @konsumlamm "`dicard` just discards the": so something like looping infinitely or raising an exception |
20:07:13 | * | jjido joined #nim |
20:11:34 | FromDiscord | <gerwy> In reply to @treeform "now days linked lists": still need to learn them tho hah |
20:18:10 | FromDiscord | <Elegantbeef> @Ayy Lmao\: you mean proper vectors like SVG? |
20:22:57 | FromDiscord | <Ayy Lmao> In reply to @Elegantbeef "<@277645179115143178>\: you mean": It doesn't have to be any particular format. My goal is essentially to make a gui framework and I'm looking to figure out what the best way to go from describing the gui visuals as paths to viewing it on the screen. |
20:24:06 | FromDiscord | <Ayy Lmao> I've tried to look through ImGui to figure out how it is done there but there's so much going on it's hard to parse through it all. |
20:28:05 | FromDiscord | <Elegantbeef> You could look how pixie renders paths, and that may help, generally gpu based vector rendering is quite complex |
20:36:59 | FromDiscord | <Ayy Lmao> In reply to @Elegantbeef "You could look how": From what I can tell in the examples, pixie draws a quad over the whole screen, binds a texture to the quad, and then draws the paths as pixels to the texture. I think ImGui is actually describing the layout to the gpu and having the gpu draw it if I'm not mistaken. |
20:37:20 | FromDiscord | <garett> Ayy lmao, you might look at https://github.com/memononen/nanovg |
20:37:23 | nrds | <R2D299> itHub: 7"Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations." |
20:40:20 | FromDiscord | <Ayy Lmao> In reply to @garett "Ayy lmao, you might": I've been meaning to dig into that and see if I can understand it. It seems like a nice concise way of doing gpu vector graphics. |
20:41:13 | FromDiscord | <garett> Might try rewriting it in Nim to understand it |
20:41:30 | FromDiscord | <garett> I can’t claim to understand it |
20:44:53 | FromDiscord | <Ayy Lmao> Maybe I'll try at some point. I'm not super great at c and c++ so it would probably be quite difficult. |
20:46:32 | * | supakeen quit (Remote host closed the connection) |
20:46:56 | * | supakeen joined #nim |
21:12:09 | FromDiscord | <treeform> In reply to @Elegantbeef "You could look how": I can second this. GPU makes it like x10 harder. |
21:13:50 | FromDiscord | <treeform> In reply to @Ayy Lmao "From what I can": That is correct, pixie is pure CPU library. The demo api we have is not made for performance only to show how to simply do it. |
21:16:49 | FromDiscord | <treeform> A better way to do is to "cache" every component you have into an atlas when stuff changes, and only draw GPU atlas quads most frames. |
21:17:26 | * | Gustavo6046 quit (Ping timeout: 250 seconds) |
21:17:34 | * | Gustavo6046_ joined #nim |
21:19:01 | FromDiscord | <Ayy Lmao> In reply to @treeform "A better way to": I will have to look into that. I was having some lag issues with resizing the window with using a single texture. |
21:19:49 | * | Gustavo6046_ is now known as Gustavo6046 |
21:21:27 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
21:35:49 | FromDiscord | <treeform> Yeah single texture is for simple demos only. |
21:36:11 | FromDiscord | <treeform> Its just a way to get an image onto the screen |
21:59:45 | FromDiscord | <TechnoRazor> I finally got Optick to work |
22:02:37 | FromDiscord | <TechnoRazor> sent a code paste, see https://play.nim-lang.org/#ix=3wH7 |
22:02:56 | FromDiscord | <TechnoRazor> @haxscramper |
22:03:34 | FromDiscord | <TechnoRazor> (edit) "https://play.nim-lang.org/#ix=3wH7" => "https://play.nim-lang.org/#ix=3wH8" |
22:05:13 | * | max22- quit (Quit: Leaving) |
22:25:34 | FromDiscord | <⃟⃟> how do i make the omission of `()` for function calls an error |
22:25:51 | FromDiscord | <Recruit_main707> pretty sure you cant |
22:25:54 | FromDiscord | <TechnoRazor> Why would you want to? |
22:26:03 | FromDiscord | <Recruit_main707> just write them xd |
22:28:29 | FromDiscord | <⃟⃟> i would like to add a flag to the compiler |
22:28:32 | FromDiscord | <⃟⃟> how can i do this? |
22:29:20 | madprops | what's the best way to turn 1.199999 into "1.2" ? |
22:29:22 | FromDiscord | <konsumlamm> you can't without using github at least |
22:29:27 | FromDiscord | <Elegantbeef> Forking the compiler and adding it, but then have fune with properties |
22:29:59 | FromDiscord | <konsumlamm> In reply to @madprops "what's the best way": there should be a round function in std/math or systen |
22:30:10 | FromDiscord | <⃟⃟> why do i need github for this?? |
22:30:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3wHf |
22:30:21 | FromDiscord | <Elegantbeef> Cause it's not a feature of the compiler |
22:30:22 | FromDiscord | <⃟⃟> they should use a different platform |
22:30:38 | FromDiscord | <Elegantbeef> There is a gitlab mirror iirc |
22:30:41 | FromDiscord | <konsumlamm> In reply to @⃟⃟ "why do i need": because that's where Nim's source code is? |
22:31:04 | FromDiscord | <⃟⃟> can i just email someone the changes? |
22:31:10 | FromDiscord | <Elegantbeef> You dont need github account you can just git clone and host your fork |
22:31:41 | FromDiscord | <Recruit_main707> In reply to @⃟⃟ "can i just email": no, you can make a suggestion and if it receives enough attention then it may be done |
22:33:53 | * | byanka joined #nim |
22:34:02 | FromDiscord | <konsumlamm> if you want to contribute to Nim in any meaningful way, you gotta use GitHub |
22:34:10 | FromDiscord | <konsumlamm> or find someone else to do it for you |
22:34:21 | FromDiscord | <konsumlamm> (no, i won't do it for you) |
22:37:24 | FromDiscord | <Recruit_main707> may i ask why do you want that? you can just avoid it yourself |
22:38:14 | FromDiscord | <⃟⃟> i dont like the feature |
22:38:21 | FromDiscord | <⃟⃟> so i want to effectively disable it |
22:38:58 | FromDiscord | <haxscramper> It would break huge portion of the stdlib |
22:39:09 | FromDiscord | <haxscramper> And you can write custom compiler tooling |
22:39:16 | FromDiscord | <haxscramper> I linked example already |
22:39:43 | FromDiscord | <Elegantbeef> It almost certainly wouldnt be supported by the compiler since no one else wants it |
22:40:04 | FromDiscord | <haxscramper> In reply to @haxscramper "https://github.com/haxscramper/hack/blob/master/tes": . |
22:40:12 | FromDiscord | <haxscramper> Check for anything you like |
22:40:16 | FromDiscord | <haxscramper> In any way you like |
22:40:24 | FromDiscord | <haxscramper> And btw no need for GitHub |
22:40:30 | FromDiscord | <dom96> honestly, don't do this. Either get consensus from everyone in the community or use a different language |
22:40:32 | FromDiscord | <haxscramper> And it is easier to implement |
22:40:35 | FromDiscord | <⃟⃟> so using that how do i make it happen when i do `nim c` |
22:41:01 | FromDiscord | <haxscramper> Just run it as separate binary |
22:41:12 | FromDiscord | <haxscramper> Or, well, you can make custom compielr pass |
22:41:15 | FromDiscord | <haxscramper> If you want |
22:41:18 | madprops | I'm using: formatFloat(float(num), format=ffDecimal, precision=1) |
22:41:25 | FromDiscord | <⃟⃟> the thing is then i have to make sure i make it scan all the files being used when i do `nim c` |
22:41:28 | madprops | how can I avoid cases like 2.0 and return 2 |
22:41:29 | FromDiscord | <haxscramper> Gove me a second, I have example for full pipelin |
22:41:30 | madprops | ? |
22:42:17 | FromDiscord | <haxscramper> https://github.com/haxscramper/hack/blob/master/testing/nim/compilerapi/test11/full_compilation_pipeline.nim |
22:42:18 | FromDiscord | <haxscramper> Here |
22:42:21 | FromDiscord | <⃟⃟> trimzeros |
22:42:23 | FromDiscord | <haxscramper> Your personal nim c |
22:42:45 | FromDiscord | <haxscramper> Start to end full compilation pipeline, in 47 lines |
22:43:16 | FromDiscord | <⃟⃟> what is that tmp thing |
22:43:29 | FromDiscord | <haxscramper> Only for c backend and no configuration, but if you want that would be a good start |
22:43:50 | FromDiscord | <haxscramper> In reply to @⃟⃟ "what is that tmp": /tmp? |
22:43:59 | FromDiscord | <Recruit_main707> honestly, if you really want to do this go ahead, but i dont think you have enough knowledge about nim, its gonna be painful, frustrating and you will most likely not even finish it |
22:44:00 | FromDiscord | <haxscramper> Linux temporary directory |
22:44:01 | FromDiscord | <⃟⃟> is there a way to make it just use the normal compiler but add one step |
22:44:15 | FromDiscord | <haxscramper> Fork nim compiler? |
22:44:23 | FromDiscord | <haxscramper> Already has been suggested |
22:44:24 | FromDiscord | <⃟⃟> well your way seems simpler |
22:44:29 | FromDiscord | <dom96> honestly, there are far better things to be doing then creating a fork of Nim just to make `()` mandatory |
22:44:34 | FromDiscord | <dom96> (edit) "then" => "than" |
22:44:42 | FromDiscord | <⃟⃟> like using mathematica? |
22:44:44 | FromDiscord | <haxscramper> In reply to @⃟⃟ "well your way seems": Because it is an example that is made to be simple |
22:45:01 | FromDiscord | <Recruit_main707> i mean, its him doing for himself, i dont care |
22:45:39 | FromDiscord | <haxscramper> And btw, @⃟⃟ what is wrong with GitHub that you absolutely refuse to use it? |
22:45:51 | FromDiscord | <sealmove> how to see where the index out of bounds happen? |
22:46:04 | FromDiscord | <⃟⃟> i used it once then it annoyed me so much i stopped using it |
22:46:10 | FromDiscord | <Recruit_main707> i just recommend him to not because i know from my own experience this kind of stuff never results in a good outcome |
22:46:29 | FromDiscord | <⃟⃟> is there a nim backend for mathematica? |
22:46:35 | FromDiscord | <haxscramper> No |
22:47:04 | FromDiscord | <⃟⃟> is it being worked on right now? |
22:47:13 | FromDiscord | <haxscramper> No, of course not |
22:47:30 | FromDiscord | <Recruit_main707> isnt it propietary? |
22:47:35 | FromDiscord | <konsumlamm> In reply to @รєคɭ๓๏שє "how to see where": look at the stacktrace? ot wdym? |
22:47:47 | FromDiscord | <⃟⃟> wolfram mathematica is i think |
22:48:09 | FromDiscord | <haxscramper> Wolfram Mathematica is a software system with built-in libraries for several areas of technical computing that allow machine learning, statistics, symbolic computation, manipulating matrices, plotting ... ↵↵> License: Proprietary |
22:48:26 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=3wHh |
22:48:27 | FromDiscord | <haxscramper> I'm pretty sure there is like 3.5 people who would need nim to have backend for that |
22:48:39 | FromDiscord | <⃟⃟> 0.5 person? |
22:48:40 | FromDiscord | <konsumlamm> so many? |
22:49:35 | FromDiscord | <Recruit_main707> Matematica's attractive is actually using it, the fancy plotting stuff and builtins, a nim wrapper of some sort would be more useful |
22:49:47 | FromDiscord | <konsumlamm> In reply to @⃟⃟ "i used it once": ... |
22:49:49 | FromDiscord | <Recruit_main707> but not doable afaik |
22:50:32 | FromDiscord | <⃟⃟> why not |
22:50:35 | FromDiscord | <haxscramper> I guess if you can call into it somehow, either via FFI, or shell command |
22:51:00 | FromDiscord | <haxscramper> But I'd better use open-source stuff written in nim |
22:51:29 | FromDiscord | <Recruit_main707> if matematica somehow allows you to interop with c/cpp code then maybe, but again, painful, frustrating, complex and very likely to never end |
22:51:41 | FromDiscord | <haxscramper> Than proprietary "Written in: Wolfram Language, C/C++, Java", no thanks |
22:51:53 | FromDiscord | <⃟⃟> i thought nim could turn into javascript though |
22:52:01 | FromDiscord | <Recruit_main707> c/cpp/js |
22:52:11 | FromDiscord | <haxscramper> +Objc |
22:52:12 | FromDiscord | <⃟⃟> well if javascript works i dont see why not mathematica |
22:52:26 | FromDiscord | <⃟⃟> i assume javascript dosent use some kind of C interop |
22:52:38 | FromDiscord | <haxscramper> It is possible, just pointless |
22:53:02 | FromDiscord | <dom96> mathematica isn't really a platform |
22:53:02 | FromDiscord | <Recruit_main707> a whole team of people very experienced in the language, (since they created it), made the js backend, one enthusiast has basically cero chance |
22:53:14 | FromDiscord | <dom96> JS/ObjC/C++/C offers discrete platforms |
22:53:24 | FromDiscord | <⃟⃟> discrete? platform? |
22:53:29 | FromDiscord | <⃟⃟> non jargon please |
22:54:24 | FromDiscord | <haxscramper> We could target something like java to reach for JVM, or one of .net languages, this would be more useful |
22:55:38 | FromDiscord | <haxscramper> Though everything is just rubbish compared to brainfuck - any real language ought to have BF backend |
22:56:38 | FromDiscord | <⃟⃟> νο |
22:56:45 | FromDiscord | <Recruit_main707> fr, i dont want interfaces, where is my brainfuck backend, literally unusable |
22:57:16 | FromDiscord | <konsumlamm> making a bf bsckend is fun |
22:57:20 | FromDiscord | <haxscramper> `{.emit: ++++++++--->I]"}` |
22:57:26 | FromDiscord | <konsumlamm> if you don't want dynamic allocations at least |
23:05:49 | FromDiscord | <dom96> you joke, but a brainfuck -> Nim AST macro would be epic |
23:08:52 | FromDiscord | <konsumlamm> actually, i don't, i really made a brainfuck backend once |
23:13:09 | * | flynn quit (Read error: Connection reset by peer) |
23:14:15 | * | flynn joined #nim |
23:34:12 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3wHo |
23:34:33 | FromDiscord | <Ayy Lmao> (edit) "https://play.nim-lang.org/#ix=3wHo" => "https://play.nim-lang.org/#ix=3wHp" |
23:35:45 | FromDiscord | <Ayy Lmao> Pixie's resize function looks pretty hefty so probably isn't meant to be called frequently. |
23:46:38 | FromDiscord | <guzba> In reply to @Ayy Lmao "Pixie's resize function looks": pixie's `resize` will do all the work of scaling an image down which is expensive yeah. if data.setLen resizing works, which is just dropping data, thats all good and will be far faster. one thing that may be an option is to just do texture.image = newImage(window.clientWidth, window.clientHeight) if you do not need the cropped pixel values but idk if that fits in your scenario |
23:47:23 | FromDiscord | <guzba> (edit) "resizing" => "clipping" |
23:48:42 | FromDiscord | <Ayy Lmao> In reply to @guzba "pixie's `resize` will do": I'm immediately redrawing the texture after every resize so it seems to work nicely for me to just resize it manually. |
23:49:38 | FromDiscord | <Ayy Lmao> Unless `texture.image = newImage(window.clientWidth, window.clientHeight)` is faster, I haven't done any testing |
23:50:08 | FromDiscord | <guzba> it wouldn't be be any different |
23:50:19 | FromDiscord | <guzba> so whatever you prefer is all good |