<< 22-08-2021 >>

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