<< 19-09-2022 >>

00:30:22FromDiscord<auxym> also important to note: if anything you're doing can be optimized as a "bitwise op" (for example shl instead of division by power of 2), then its highly probable that gcc O2 or O3 will do that optimization for you.
00:40:59FromDiscord<Generic> gcc will do that optimisation even with O1
00:41:04FromDiscord<auxym> damn, even with O0, gcc is optmizing "divide by 13" to "multiply by 1321528399 and some shifts
00:41:14FromDiscord<auxym> https://godbolt.org/z/a5fcbKjcc
00:41:42FromDiscord<Generic> it's probably because those optimisations are guaranteed to be always better
00:41:43FromDiscord<Elegantbeef> Cmon why not using nim?!
00:42:05FromDiscord<Generic> in terms of speed and about equal or less in terms of code size
00:42:55FromDiscord<auxym> In reply to @Elegantbeef "Cmon why not using": because I get lost somewhere in the ~12 extra asm instructions that nim generates D:
00:43:46FromDiscord<Elegantbeef> It's not too bad https://godbolt.org/z/a5YxobWj9
00:44:08FromDiscord<Generic> I know that complaining isn't very productive
00:44:21FromDiscord<Generic> but Nim on Godbolt isn't that useful
00:44:23FromDiscord<Elegantbeef> Wait it's not?!
00:44:32FromDiscord<Generic> you can't compare between compilers and architectures
00:45:03FromDiscord<Generic> it's only x64 gcc
00:45:59FromDiscord<Generic> (edit) "you can't compare between ... compilers" added "C"
00:50:14FromDiscord<exelotl> this
00:50:30FromDiscord<Elegantbeef> No dont use `this`
00:53:06FromDiscord<auxym> self?
00:53:13FromDiscord<Elegantbeef> Not that either
00:53:33FromDiscord<exelotl> that
00:57:44FromDiscord<Patitotective> beef prefers `myLongObjectName`
01:02:56FromDiscord<auxym> you should see the stuff I'm writing these days https://github.com/auxym/nim-tinyusb/blob/master/src/tinyusb/class/cdc.nim#L262 I hate it D:
01:03:35FromDiscord<Patitotective> im sure beef will love `proc foo(cdcAbstractControlMgmtDescriptor: CdcAbstractControlMgmtDescriptor)`
01:04:29FromDiscord<Elegantbeef> Oh this is porting the stuff the C used macros for?
01:06:55FromDiscord<auxym> yeah. it's way more of a PITA than I imagined. but it's almost done, only thing WIP is HID report descriptors
01:07:06FromDiscord<auxym> I was not planning on reading a whole bunch of USB specs
01:07:11FromDiscord<Patitotective> you're gonna live this beef, KDL allows empty type annotations↵meaning that `("")node 1 2 3` should be printed out as `("")node 1 2 3`
01:07:16FromDiscord<Patitotective> (edit) "live" => "love"
01:08:03FromDiscord<Elegantbeef> KDL is a joke
01:08:40FromDiscord<Patitotective> i might better hard-fork it and fix it :p
01:09:00FromDiscord<Elegantbeef> Then it's a purposeless file format
01:09:16FromDiscord<Patitotective> ?
01:09:20FromDiscord<Patitotective> (edit) "?" => "🤨"
01:09:25FromDiscord<auxym> haven't actually used it, but on the surface, I like how it looks compared to toml, yaml, etc
01:09:58FromDiscord<Elegantbeef> Sure but it's spec is quite odd
01:10:01FromDiscord<auxym> also json pisses me off with the no comments and no trailing comma thing
01:10:10FromDiscord<Patitotective> In reply to @auxym "haven't actually used it,": it also looked nice but specification is too vague, it doesnt seem mature
01:10:23FromDiscord<Elegantbeef> By forking the spec you now have a second variant that looks the same but behaves differently
01:11:03FromDiscord<Patitotective> POML: pats obvious minimal language
01:11:27FromDiscord<Patitotective> In reply to @Elegantbeef "By forking the spec": different extension
01:12:15FromDiscord<auxym> which parts are vague? out of curiosity. and how do the existing implementations resolve the ambiguous parts?
01:12:27FromDiscord<Elegantbeef> 😛
01:12:27FromDiscord<Elegantbeef> What's an extension?
01:16:07FromDiscord<Patitotective> sent a long message, see http://ix.io/4aSl
01:18:54FromDiscord<Patitotective> KDL is a fork of SDL so another fork is not that bad :p
01:20:08FromDiscord<auxym> meh, personally I'd just follow whatever the most-used existing implementations are doing
01:21:02FromDiscord<Patitotective> you mean, just use json
01:22:03FromDiscord<auxym> json5 😉
01:22:03FromDiscord<Patitotective> In reply to @Elegantbeef "😛": i dont get your inanities
01:22:04FromDiscord<Patitotective> :p
01:27:07FromDiscord<Patitotective> but they, the author agrees with me https://media.discordapp.net/attachments/371759389889003532/1021230923833946122/unknown.png
01:27:31FromDiscord<Patitotective> (edit) "they," => "hey,"
01:31:03FromDiscord<Elegantbeef> You use linux pat extensions dont mean anything
01:32:11FromDiscord<Patitotective> extensions live in my heart
01:33:43FromDiscord<Elegantbeef> They're lies that make people sleep better at night
01:34:26FromDiscord<Patitotective> how can i get a nice icon in my file explorer without extensions?
01:34:56FromDiscord<Elegantbeef> Have a preview api and attempt to decode the file until it succeeds
01:35:09FromDiscord<Elegantbeef> Clearly the most efficient way of doing it
01:35:45FromDiscord<Patitotective> even better, train an AI to guess a file's extension from it's content
01:37:53FromDiscord<Elegantbeef> Extensions are a ploy by big windows to attempt to know what you want
01:40:39*attah joined #nim
01:43:10FromDiscord<Rika> I mean technically magic bytes are just extensions but in the file
01:43:46FromDiscord<auxym> both magic bytes and extensions are sort of a hack, to think of it
01:43:59FromDiscord<Rika> Well there isn’t a good solution
01:44:24FromDiscord<auxym> btw @retkid this might be of interest if you are into bit-twiddling https://graphics.stanford.edu/~seander/bithacks.html
01:44:29FromDiscord<Rika> Consider two programming languages with syntaxes that don’t differ that much, how would either be distinguished without either extensions or magic bytes?
01:44:48FromDiscord<Rika> Cough cough
01:45:17FromDiscord<Elegantbeef> If they're similar enough tools cannot distinguish them they're the same language! 😛↵(@Rika)
01:45:21FromDiscord<auxym> I agree, there's no clean solution. filesystem attrs would be another option but also has at least as many problems with it
01:45:36FromDiscord<Elegantbeef> The real solution is feed it to a compiler/runtime, if it succeeds it's that file type!
01:45:41FromDiscord<Rika> In reply to @auxym "I agree, there's no": Not portable haha
01:45:47FromDiscord<Patitotective> `print("Hello World")`↵what language is that?
01:46:25FromDiscord<Elegantbeef> The only way to know if a file is the type you want is by attempting it
01:47:38FromDiscord<Patitotective> you shouldnt go changing extensions through folders
01:47:48FromDiscord<Patitotective> everything just works lol
01:48:23FromDiscord<huantian> In reply to @Patitotective "`print("Hello World")` what language": I mean in that case the best way is just the shebang
01:48:25FromDiscord<huantian> or you just guess
01:48:30FromDiscord<huantian> or you don't guess anything
01:49:11FromDiscord<huantian> like if its not identifyable you just assume either plain text, or bytes
01:49:33FromDiscord<Elegantbeef> Yall would use regex to validate emails!
01:50:03FromDiscord<Patitotective> In reply to @Elegantbeef "Yall would use regex": `'@' in email`
01:50:17FromDiscord<Rika> In reply to @Elegantbeef "Yall would use regex": You would try eating a book because you didn’t know it was a book
01:50:48*wallabra quit (Ping timeout: 264 seconds)
01:50:51FromDiscord<Patitotective> hahah
01:53:42FromDiscord<Elegantbeef> Hey if papers good enough for the beaver why not me↵(@Rika)
01:55:58FromDiscord<Patitotective> is it bad using `type None = object`?
01:56:11*attah quit (Ping timeout: 260 seconds)
01:56:56FromDiscord<auxym> `void`?
01:57:10FromDiscord<Patitotective> always forget
01:57:50FromDiscord<auxym> you can also use `distinct void`
01:57:57FromDiscord<auxym> stole that from beef
01:58:30FromDiscord<Patitotective> why would i want a distinct void 🤔
01:58:44FromDiscord<auxym> type system black magic fuckery
02:00:00FromDiscord<auxym> your proposed empty object would behave like a `distinct void` though. ie `type None1 = object` and `type None2 = object` are not the same type (nominal typing)
02:00:40FromDiscord<auxym> or maybe you want them to be the same 🤷‍♂️
02:00:52FromDiscord<Elegantbeef> Plus you dont have people thinking they're smart passing `void` instead of `None` 😄
02:01:11FromDiscord<Elegantbeef> YMMV
02:01:11FromDiscord<Elegantbeef> Type aliases are nice but i think people generally misunderstand their reason for existing
02:01:49FromDiscord<Elegantbeef> Tuples are one place i feel people really misunderstand type aliases
02:03:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aSq
02:03:43FromDiscord<Elegantbeef> But not all `(string, int)` are actually `Person`
02:03:58FromDiscord<Elegantbeef> Since they're structurally typed that's something people seem to mis
02:05:22FromDiscord<Rika> Doesn’t it match field names too? Just not type name
02:05:39FromDiscord<Elegantbeef> Nope tuples just match types
02:05:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aSs
02:06:14FromDiscord<Rika> If they’re anonymous yes
02:06:27FromDiscord<Rika> If the tuple passed has names then doesn’t it check those too
02:07:04FromDiscord<Bung> it may resolve generic problem, void type arguments are striped out when generate proc
02:07:20FromDiscord<Elegantbeef> seems you're right rika
02:07:27FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1021241075635060756/image.png
02:10:05FromDiscord<Elegantbeef> I honestly only use tuples for return types so didnt realise this semantic existed
02:10:20FromDiscord<Patitotective> it would be cool if inim allowed multi-line statements
02:11:02FromDiscord<Elegantbeef> PRs welcome 😛
02:11:08FromDiscord<Elegantbeef> And it does support multiine statements.... on flow control
02:11:41FromDiscord<Elegantbeef> For instance
02:11:44FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1021242144394072144/image.png
02:11:48FromDiscord<Patitotective> oh, really cool, didnt know
02:12:48FromDiscord<Elegantbeef> Hmmph needs syntax highlighting
02:12:49FromDiscord<Elegantbeef> Patito you got that? 😛
02:14:06FromDiscord<Patitotective> you mean the text editor i was doing in imgui?
02:14:15FromDiscord<Elegantbeef> No i mean in inim
02:15:40FromDiscord<Patitotective> can macros be generic 👀
02:15:55FromDiscord<slymilano> I actually used Nim tuples for the first time tonight - I'm so used to Elixir's `{:ok, foobar} | {:error, foobar}` pattern, this felt nice https://media.discordapp.net/attachments/371759389889003532/1021243209290096640/unknown.png
02:15:59FromDiscord<Elegantbeef> Yes but only limited
02:16:08FromDiscord<Patitotective> how limited
02:16:25FromDiscord<Elegantbeef> Jusut use an option sly 😄
02:16:29FromDiscord<Patitotective> In reply to @slymilano "I actually used Nim": rusts result
02:16:44FromDiscord<Elegantbeef> What do you need pat
02:16:50FromDiscord<Elegantbeef> Instead of making me guess ask the actual question
02:17:39FromDiscord<Elegantbeef> Actually never mind you're uusing results
02:17:43FromDiscord<Elegantbeef> There is the results package if you want that
02:17:47FromDiscord<Elegantbeef> Personally though i find exceptions just better
02:18:12FromDiscord<huantian> I did some rust and I think I did results wrong
02:18:19FromDiscord<huantian> because I just used them like exceptions
02:18:35FromDiscord<Elegantbeef> I mean that's what they are afaict
02:18:51FromDiscord<Elegantbeef> They move the flow control from a stack unwind to the user explicitly unpacking them
02:20:08FromDiscord<Elegantbeef> Instead of putting `parseInt` inside a try except you attempt to parse and return an result which you must check to get the value
02:20:17FromDiscord<Elegantbeef> There's a reason they're an alternative to exceptions
02:20:23FromDiscord<Elegantbeef> Cause they quite literally are just more explicit and manual exceptions
02:20:39FromDiscord<Elegantbeef> If you want to do what most do in Nim without `raises` you just use `?` to unpack and possibly panic
02:21:39FromDiscord<Elegantbeef> In the case of parseint i'd probably argue for options over exceptions, but i generally prefer exceptions over results
02:24:15FromDiscord<Rika> Most people don’t even care about the result thing and just do ?
02:24:25FromDiscord<Rika> Which makes me think “the fuck was the point of that then”
02:24:29FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4aSt
02:24:35FromDiscord<Patitotective> so was thinking about generics but dont actually need them
02:24:40FromDiscord<Elegantbeef> And why does the macro need generic
02:24:44FromDiscord<Patitotective> `typed` would work right?
02:24:51FromDiscord<Elegantbeef> Ah yea there you go
02:25:02FromDiscord<Elegantbeef> `typedesc`
02:25:18FromDiscord<Elegantbeef> also cmon do `parsing: bool` like a normal person
02:25:35FromDiscord<Patitotective> forgot i could do that :p
02:25:59FromDiscord<Elegantbeef> Yea rika quite a few people dislike the fact `?` exists
02:26:00*attah joined #nim
02:26:31FromDiscord<Elegantbeef> You now have code that can panic and it's just worse
02:26:48FromDiscord<Elegantbeef> Nim's exception tracking + raises is ideal
02:28:41FromDiscord<Patitotective> not going `/home/cristobal/minidev/kdl-nim/src/kdl/parser.nim(90, 1) Error: illformed AST: Match[Token]`↵https://github.com/Patitotective/kdl-nim/blob/main/src/kdl/parser.nim#L19
02:29:24*wallabra joined #nim
02:31:35FromDiscord<Elegantbeef> https://github.com/rust-lang/rfcs/pull/2388 ah rust is funny sometimes
02:31:46FromDiscord<Elegantbeef> `echo result.treeRepr`↵`echo result.repr`
02:32:08FromDiscord<Patitotective> fine
02:32:48FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aSu
02:32:51FromDiscord<huantian> doesnt' rust also have the yeet expresion or something
02:33:02FromDiscord<huantian> https://github.com/rust-lang/lang-team/issues/160
02:33:03FromDiscord<huantian> yeah
02:33:07*Just-Jasmine joined #nim
02:33:13FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4aSv
02:33:17FromDiscord<huantian> I have no idea what rust is doing
02:34:55FromDiscord<Elegantbeef> Yeet is a joke PR
02:35:29FromDiscord<Just Jasmine, Please> Do they really have a thing in their language called yeet??
02:35:40FromDiscord<Elegantbeef> Patito you say fine like you wanted me to work on the problem
02:36:10*Just-Jasmine quit (Client Quit)
02:36:30wallabraJS also has +[]() and other weird things you can do with it, but doesn't matter because most programmers won't
02:36:32wallabraSame with Rust's yeet
02:36:38wallabraDon't judge a language by such things that never happen in real life lol
02:37:05wallabraIt's like judging a wardrobe because it has a nail that's jutting out a bit, when it's the backside that should be against a wall to begin with
02:37:06FromDiscord<Patitotective> In reply to @Elegantbeef "Patito you say fine": hehe i already solved it↵i say fine like i was admitting my bad
02:37:09FromDiscord<Elegantbeef> It's mostly a joke but it's reserved
02:37:26FromDiscord<Elegantbeef> Uh oh we said rust too many times
02:37:36FromDiscord<Patitotective> v
02:37:49FromDiscord<Elegantbeef> Nah we cannot say V enough to summon the 2 Vv users
02:38:11FromDiscord<Patitotective> haha
03:03:51FromDiscord<Patitotective> is `compiles(a)` the best way to know if a symbol is defined?
03:04:00FromDiscord<Elegantbeef> `declared` exists
03:11:11FromDiscord<huantian> Hey beef was considering if you could do polymorphic (de)serialization for json with some macros
03:11:25FromDiscord<huantian> Like you have a pragma on the base type and one on each child?
03:12:56FromDiscord<Elegantbeef> You could store the name of the type in a list then inside the deserialise procedure unpack it yes
03:13:12FromDiscord<Elegantbeef> But that requires the name to be accessible in the module deserialising
03:13:16FromDiscord<Elegantbeef> You do mean runtime polymorphism right?
03:13:51FromDiscord<huantian> Is that what it’s called?
03:14:27FromDiscord<huantian> But hmmm yeah it would have to be in the same module or something
03:14:51FromDiscord<Elegantbeef> It doesnt have to be in the same module
03:15:24FromDiscord<Elegantbeef> You just need to be able to access the type in the module you're deserialising
03:18:23FromDiscord<Elegantbeef> Something like this should work
03:18:25FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aSB
03:18:55FromDiscord<Elegantbeef> Aslong as you call unpack after you subscribe the type
03:19:24FromDiscord<Elegantbeef> This is the issue with deserialising, there is no way to go "Hey generate code after all types are created"
03:20:07FromDiscord<Elegantbeef> You basically need the logic for method calls to happen
03:21:11FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4aSC
03:21:39FromDiscord<Elegantbeef> Obviously the latter
03:21:42FromDiscord<Rika> I’m betting he likes latter
03:21:48FromDiscord<Rika> Wait for me you dingus
03:22:04FromDiscord<Elegantbeef> Sorry
03:22:23FromDiscord<Patitotective> In reply to @Rika "Wait for me you": dingus
03:22:39FromDiscord<Rika> In reply to @Patitotective "dingus": No you
03:22:55FromDiscord<Patitotective> dingus sounds so funny, like really
03:25:02FromDiscord<Rika> Lol
03:26:08FromDiscord<Patitotective> imagine a picture of a cat saying dingus↵i bet it already exists
03:26:38FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=4aSD
03:27:01FromDiscord<Patitotective> code??
03:29:14FromDiscord<Elegantbeef> That code is to ensure there isnt a type mismatch
03:32:57FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=4aSE
03:33:36FromDiscord<Elegantbeef> Are you sure you're using a compiler that matches your CPU's arch?
03:34:33FromDiscord<ynfle> Nop
03:34:35FromDiscord<ynfle> Nope
03:34:40FromDiscord<ynfle> How do I chech that
03:34:45FromDiscord<ynfle> And I installed with choosenim
03:35:08FromDiscord<ynfle> `Nim Compiler Version 1.6.6 [Windows: i386]`
03:37:26FromDiscord<ynfle> I have 64 bit which I'm assuming means it doesn't match
03:37:48FromDiscord<ynfle> How can I get the right one and why doesn't choosenim determine that?
03:39:01FromDiscord<Patitotective> try `nim c --cpu:amd64 file.nim`
03:39:40FromDiscord<ynfle> works
03:40:19FromDiscord<ynfle> How can I switch and tell choosenim to switch
03:41:04FromDiscord<ynfle> Choosenim says it's 64 bit `choosenim v0.8.4 (2022-07-06 14:50:55) [windows/amd64]`
03:43:28FromDiscord<Elegantbeef> compile with `--listCmd` and also check `which gcc`
03:45:18FromDiscord<ynfle> gcc is the nimble one
03:45:25FromDiscord<Elegantbeef> Sure but it installed 32bit nim so something on your system makes it think it's 32bit
03:45:27FromDiscord<Elegantbeef> I could've sworn someone else had this issue
03:46:16FromDiscord<ynfle> I definitely heard of this issue before on here
03:46:33FromDiscord<Elegantbeef> I dont recall what the fix was though sadly
03:46:46FromDiscord<ynfle> What will `--listCmd` show?
03:46:54FromDiscord<Elegantbeef> Gcc flags
03:49:52FromDiscord<ynfle> Doesn't seem too interesting
05:45:44*xet7 quit (Quit: Leaving)
06:13:26FromDiscord<jan0809> what msys?
06:22:30FromDiscord<Girvo> I know I've asked this before, but whats the size in-memory of a `none(T)` and does it depend on `T`?
06:22:57FromDiscord<Elegantbeef> Yes it depends it's atmost `sizeof(int) + sizeof(T)`
06:23:34FromDiscord<Elegantbeef> atleast it'ss `sizeof(byte) + sizeof(T)`
06:23:38FromDiscord<Elegantbeef> Alignment/padding is a bitch 😄
06:29:35FromDiscord<PyryTheBurger> How do i have a seq of typedescs
06:29:51FromDiscord<PyryTheBurger> Like @[int, string]
06:29:56FromDiscord<Elegantbeef> You dont
06:30:01FromDiscord<PyryTheBurger> Bruh
06:30:19FromDiscord<Elegantbeef> What are you actually after
06:30:33FromDiscord<PyryTheBurger> In reply to @PyryTheBurger "Like @[int, string]": .
06:30:45FromDiscord<Elegantbeef> Nim's types do not exist at runtime so things like `@[int, string]` makes no sense
06:30:46FromDiscord<Elegantbeef> So what are you actually after
06:30:59FromDiscord<PyryTheBurger> That thing
06:32:05FromDiscord<Elegantbeef> Why do you need a collection of types?
06:32:09FromDiscord<Elegantbeef> Like there has to be a reason
06:33:02FromDiscord<Rika> The best you will be able to get is a tuple of type descent
06:33:05FromDiscord<Rika> Descs
06:51:44FromDiscord<jan0809> i think its about union types(?)
06:52:12FromDiscord<jan0809> that would make sense atleast
06:52:20FromDiscord<Rika> We ask because we are unsure
07:23:35*hochata quit (Ping timeout: 268 seconds)
07:49:23*rockcavera quit (Ping timeout: 265 seconds)
08:13:34FromDiscord<Bung> any idea how to fix this https://github.com/nim-lang/Nim/issues/4448 , haven't found where the mutability `var` stored
08:15:03FromDiscord<Elegantbeef> Isnt it just in the type as `tyVar`?
08:15:22FromDiscord<retkid> something i would like is the ability to use all templates functions and macros like var
08:15:35FromDiscord<Bung> so it's son of tyVar taken into generic ?
08:15:36FromDiscord<Elegantbeef> What?
08:15:55FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=4aTJ
08:16:05FromDiscord<Elegantbeef> it should be `tyOr(tyVar(MyObject), tyRef(MyObject))`
08:16:26FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=4aTK
08:16:27FromDiscord<retkid> thats a cool feature i'd like
08:16:44FromDiscord<Rika> I don’t even understand the feature you ask for
08:16:45FromDiscord<Bung> In reply to @Elegantbeef "it should be `tyOr(tyVar(MyObject),": thanks ! good explain
08:17:08FromDiscord<Elegantbeef> They want all code to allow section syntax
08:17:11FromDiscord<retkid> In reply to @Rika "I don’t even understand": each function / keyword / template / macro can be put into a codeblock and executed on all those variables
08:17:46FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=4aTL
08:17:48FromDiscord<Rika> And if they return?
08:17:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aTM
08:18:01FromDiscord<retkid> you echo a b c
08:18:05FromDiscord<retkid> ok only code which has no return
08:18:19FromDiscord<flywind> There seem to be a feature request for the function block and be rejected, but I forget which issue
08:18:24FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aTN
08:18:37FromDiscord<flywind> (edit) "There seem to be a feature request for the function block and be rejected, but I forget which issue ... " added "or forum post"
08:20:17FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=4aTO
08:20:51FromDiscord<retkid> (edit) "https://play.nim-lang.org/#ix=4aTO" => "https://play.nim-lang.org/#ix=4aTP"
08:21:02FromDiscord<Rika> No that would never be supported
08:21:09FromDiscord<Bung> I think you can make a template
08:21:23FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=4aTQ
08:21:40FromDiscord<retkid> probably
08:21:50FromDiscord<retkid> if i had one to specifically ask for
08:22:06FromDiscord<retkid> its the discard one
08:22:27FromDiscord<retkid> because sometimes I just have a ton of discards .-.
08:22:55FromDiscord<Elegantbeef> you know you can make procedures discardable?
08:23:27FromDiscord<Elegantbeef> though i dont really think having block discard are that great
08:24:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4aTU
08:24:38FromDiscord<Elegantbeef> Though i think araq wants to make the parser handle newline seperated entries in an array
08:31:20FromDiscord<Rika> Really?
08:31:52FromDiscord<Elegantbeef> IIRC he called using commas a hack and wanted to remove it
08:31:53FromDiscord<Elegantbeef> But i might be having a fever dream
08:58:13NimEventerNew Nimble package! mpv - Nim bindings for libmpv, see https://github.com/WeebNetsu/nim-mpv
09:24:31NimEventerNew thread by drkameleon: Get a pointer to a ref object and hold on to it, see https://forum.nim-lang.org/t/9478
10:00:37NimEventerNew thread by pg13: Hashsets and OpenArrays, see https://forum.nim-lang.org/t/9479
10:04:26FromDiscord<Goel> sent a code paste, see https://play.nim-lang.org/#ix=4aUo
10:05:47FromDiscord<Rika> There is a `default(T)` proc that returns the default value of the type
10:22:08*jmdaemon quit (Ping timeout: 265 seconds)
10:27:43FromDiscord<Goel> sent a code paste, see https://play.nim-lang.org/#ix=4aUv
10:28:58FromDiscord<retkid> alright
10:29:21FromDiscord<retkid> does anyone wanna work on new godot4 nim bindings through GDExtension
10:30:51FromDiscord<retkid> I guess the question is rather
10:31:20FromDiscord<retkid> is someone already working on that and do i have to start or can i hop on an already existing project
10:31:58FromDiscord<retkid> (edit) "that and do" => "it. Do"
10:34:02FromDiscord<retkid> https://github.com/Hapenia-Lans/gdextension-nim
10:34:07FromDiscord<retkid> alright time to make some prs
10:43:25*arkurious joined #nim
11:21:51FromDiscord<Forest [She/Her]> Is there no way to get decent error messages with async programming?
11:22:06FromDiscord<Forest [She/Her]> Why can't i catch errors thrown in futures like i would with synchronous programming?
11:39:13FromDiscord<Rika> In reply to @Forest "Why can't i catch": You can if you await
11:39:50FromDiscord<Rika> Otherwise you can’t because the error happens outside of the caller proc
11:40:21NimEventerNew Nimble package! packy - Library to pack dependencies in the compiled binary. Supports .dll files, see https://github.com/xrfez/packy
11:43:45FromDiscord<Rika> Bet it would be immediately flagged as a virus
11:44:44FromDiscord<retkid> how do i get the list of cpp arguments my nim used to compile a file
11:45:04FromDiscord<retkid> i need to compile a file to cpp + .h then compile the cpp seperately
11:45:11FromDiscord<retkid> (edit) "seperately" => "separately"
11:45:13FromDiscord<retkid> usecase: interop
11:49:05FromDiscord<Forest [She/Her]> In reply to @Rika "You can if you": Ah okay
11:49:58FromDiscord<retkid> yo nice system name Forest
11:58:27FromDiscord<Forest [She/Her]> `/home/raees/projects/Nim/Nimberite/modules/java/packet/unpackers.nim(20, 27) Error: invalid type: 'openArray[byte]' in this context: 'proc (length: int32, id: int32, byteArray: openArray[byte]): HandshakePacket' for proc` why am i getting an error here? I don't understand the issue
11:59:24FromDiscord<Forest [She/Her]> Nvm figured it out
12:01:39FromDiscord<Forest [She/Her]> Okay this is odd, I'm getting a type mismatch error despite my type using `openArray[byte]` when initialising it
12:02:27FromDiscord<retkid> holy in in the p
12:05:17FromDiscord<Forest [She/Her]> Now I'm getting the invalid type in the context error again
12:08:27FromDiscord<Forest [She/Her]> I'm just gonna stick to seqs
12:29:23FromDiscord<retkid> how can i compile nim from a .json
12:32:11FromDiscord<retkid> guess i can do it in bash and alter it on the fly
12:33:19FromDiscord<retkid> or well i guess we're doing it in python
12:33:23FromDiscord<retkid> naisu
12:36:10FromDiscord<aph> is there a enum thingy only 1 value can be set true?
13:40:01FromDiscord<auxym> what
13:43:57FromDiscord<retkid> @auxym I don't like the nim keybindings for godot so i wanted to use my own↵But i wanted to just be simple, so i was going to compile to cpp ↵But turns out you cant link anything in GDNative, and godot4 doesn't even have it↵So I have to use IPC
13:44:10FromDiscord<retkid> (edit) "@auxym I don't like the nim keybindings for godot so i wanted to use my own↵But i wanted to just be simple, so i was going to compile to cpp ↵But turns out you cant link anything in GDNative, and godot4 doesn't even have it↵So I have to use IPC" => "sent a long message, see http://ix.io/4aVu"
13:44:26FromDiscord<retkid> So we're running a tcp server :O
13:44:32FromDiscord<retkid> or maybe pipes
13:44:34FromDiscord<retkid> i dont quite know
13:44:44FromDiscord<retkid> something invovling streams
13:45:26FromDiscord<auxym> ok i don't know anything about godot.
13:45:36FromDiscord<auxym> keybindings? you mean bindings?
13:46:26FromDiscord<retkid> sorry brain is onfire
13:46:28FromDiscord<retkid> (edit) "onfire" => "on fire"
13:46:52FromDiscord<auxym> btw you might like zeromq for ipc, as a replacement for raw tcp sockets
13:47:52FromDiscord<retkid> ((i was dreading setting up TCP for ipc))
13:47:59FromDiscord<retkid> shit sucks
13:49:02FromDiscord<auxym> yeah try zeromq, so much nicer than bare sockets, but still pretty light and flexible
13:49:13FromDiscord<retkid> well
13:49:17FromDiscord<retkid> im more dreading the godot side
13:49:26FromDiscord<retkid> https://docs.godotengine.org/en/stable/classes/class_streampeertcp.html
13:50:11FromDiscord<auxym> yeah no idea about that
13:50:20FromDiscord<retkid> code is scary
13:50:28FromDiscord<retkid> don't let anybody tell you otherwise
14:14:14FromDiscord<retkid> @auxym Does ZMQ do the "\r\L" nim does normally
14:14:31FromDiscord<Forest [She/Her]> Anyone know what'd be the best way to know what instance of the server should calls be made to? Is it better to use a global list with IDs or just pass a reference to that object down function calls (only the last function call actually needs the reference to the server, the reference isn't used otherwise)
14:14:37FromDiscord<retkid> because im connecting but not receiving any data
14:15:02FromDiscord<retkid> In reply to @Forest "Anyone know what'd be": I default to pass my reference
14:15:04FromDiscord<retkid> whenever I can
14:15:50FromDiscord<Forest [She/Her]> I'm just trying to think if it'd be slower to do that instead of using a table with the servers in an int:server pair
14:16:01FromDiscord<retkid> no way
14:16:03FromDiscord<retkid> table will be way slower
14:16:09FromDiscord<Forest [She/Her]> Fair enough, thanks
14:16:34FromDiscord<Rika> im confused and lost
14:16:41FromDiscord<Rika> what are you guys even discussing?
14:17:55FromDiscord<Forest [She/Her]> I need to access a value from a `Server` object that stores all of the general server data, but since there can be multiple server instances, i need a way to get the correct instance
14:17:58FromDiscord<retkid> i have barely an idea
14:18:04FromDiscord<Forest [She/Her]> So i'll just be passing by references now
14:18:19FromDiscord<retkid> ah i see
14:18:35FromDiscord<retkid> Reference and table will be about the same, references might be more confusing in the code
14:18:49FromDiscord<Forest [She/Her]> With the reference as the first parameter?
14:19:13FromDiscord<retkid> you mean you give it the reference, then it defines it, then the main function can control it from there
14:19:21FromDiscord<retkid> basically
14:20:17FromDiscord<Rika> do you need reference semantics (as in copies "propagate" changes) or are you just using ref because you think it might be quicker?
14:22:05FromDiscord<auxym> In reply to @retkid "<@882793909246369864> Does ZMQ do": zmq just pushes "messages" around (from your point of view as library user). Messages are raw bytes. But messages are always guaranteed to be complete, you'll never get part of a message, so you don't need to concern yourself with "delimiters" and trying to packetize messages yourself from a raw byte stream.
14:22:36FromDiscord<retkid> no but in Nim, to read a message of an unkown size you concatenate with \r\L
14:22:47FromDiscord<retkid> (edit) "with" => "until"
14:22:57FromDiscord<auxym> messages can also be "multipart", which is useful for example as the first part can be a short, fixed length "header" that tells you what kind of message it is and other useful metadata
14:23:15FromDiscord<retkid> hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
14:23:22FromDiscord<auxym> In reply to @retkid "no but in Nim,": yeah, as I said, zmq will always send full messages.
14:23:37FromDiscord<auxym> so you don't need to concatenante and split them on \r\l or whatever
14:23:37FromDiscord<retkid> having a horrible time amt
14:23:46FromDiscord<retkid> (edit) "amt" => "atm"
14:23:47FromDiscord<retkid> but
14:23:50FromDiscord<retkid> this was expected
14:25:40FromDiscord<auxym> quick intro here: https://zguide.zeromq.org/docs/chapter1/
14:26:09FromDiscord<retkid> no
14:26:14FromDiscord<retkid> i dont even think its zmq
14:26:43FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/1021427118485282978/unknown.png
14:26:48FromDiscord<retkid> no connection
14:26:52FromDiscord<retkid> (╯°□°)╯︵ ┻━┻
14:28:34FromDiscord<auxym> well yeah if you're gonna use zmq you need it on both ends (server/client). no idea if its even possible to use it within godot or with that class or whatever, I don't know anything about godot
14:28:43FromDiscord<retkid> In reply to @auxym "well yeah if you're": really
14:28:45FromDiscord<retkid> 😭
14:29:26FromDiscord<auxym> well yeah, zmq is a protocol on top of raw tcp (or udp, pipes, other stuff), both ends need to speak it
14:29:50FromDiscord<retkid> welp back to net
14:32:03FromDiscord<apahl> sent a code paste, see https://play.nim-lang.org/#ix=4aVJ
14:32:43FromDiscord<apahl> (edit) "https://play.nim-lang.org/#ix=4aVJ" => "https://play.nim-lang.org/#ix=4aVK"
14:33:02FromDiscord<Rika> Ubuntu is, I believe, the only distro that does not ship 1.1 as well as 3
14:33:32FromDiscord<Forest [She/Her]> In reply to @retkid "you mean you give": Yeah
14:33:54FromDiscord<Forest [She/Her]> In reply to @Rika "do you need reference": Yeah i need to be able to change the data and have it reflect on the original instance
14:34:00FromDiscord<Rika> There is an open issue for support for 3
14:34:12FromDiscord<Rika> In reply to @Forest "Yeah i need to": Var parameter?
14:34:24FromDiscord<apahl> This is currently really a deal breaker for me.
14:34:35FromDiscord<Forest [She/Her]> In reply to @Rika "Var parameter?": What'd be the difference?
14:34:54FromDiscord<Rika> In reply to @Forest "What'd be the difference?": You’d be avoiding the unnecessary ref
14:41:22FromDiscord<Forest [She/Her]> Fair
14:41:27*m33mt33n joined #nim
14:52:45*m33mt33n left #nim (AndroIRC)
15:00:29*disso_peach quit (Quit: Leaving)
15:09:33FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4aW3
15:11:19FromDiscord<auxym> or with a proc instead of template, whatever
15:17:08FromDiscord<auxym> I think I was remembering wrong. macro it is.
15:26:25FromDiscord<retkid> at times
15:26:33FromDiscord<retkid> working with servers with no connections
15:26:39FromDiscord<retkid> is like banging you head against a brick wall
15:37:25FromDiscord<Patitotective> need commas, otherwhise its a statement list afaik
15:37:33FromDiscord<Patitotective> In reply to @auxym "hm so I though": .
15:41:38*rockcavera joined #nim
15:41:38*rockcavera quit (Changing host)
15:41:38*rockcavera joined #nim
15:46:17FromDiscord<retkid> so like
15:46:22FromDiscord<retkid> does netty even work?
15:51:55FromDiscord<hotdog> In reply to @retkid "does netty even work?": Yes
15:52:01FromDiscord<hotdog> What problem are you having?
15:52:08FromDiscord<retkid> no messages were being recieved
15:52:14FromDiscord<retkid> was it waiting for \r\L
15:52:31FromDiscord<hotdog> Are you using netty at both ends,
15:52:35FromDiscord<hotdog> ?
15:52:38FromDiscord<retkid> i was never told to
15:53:11FromDiscord<hotdog> It needs to be both
15:53:24FromDiscord<retkid> well
15:53:29FromDiscord<retkid> im on normal udp now
15:54:09FromDiscord<hotdog> Is this for the Godot thing?
15:54:59*hochata joined #nim
16:11:08FromDiscord<TheOctoberSurprise> sent a code paste, see https://play.nim-lang.org/#ix=4aWs
16:13:08FromDiscord<TheOctoberSurprise> (edit) "https://play.nim-lang.org/#ix=4aWs" => "https://play.nim-lang.org/#ix=4aWt"
16:22:53FromDiscord<retkid> In reply to @hotdog "Is this for the": yea
16:24:38FromDiscord<hotdog> In reply to @retkid "yea": Did the tcp one not work?
16:26:37FromDiscord<retkid> meh
16:26:39FromDiscord<retkid> tcp is slow
16:29:42FromDiscord<auxym> ...
16:30:26FromDiscord<auxym> use udp if you have to but saying that the protocol that the entire internet runs on is "slow" is sort of difficult to swallow
16:30:30FromDiscord<Bloss> will playground ever work lol
16:31:32FromDiscord<auxym> yeah PMunch was pinged a couple times but he might be on vacation or something (hope he's ok). in the meantime you can use wandbox
16:35:45FromDiscord<Bloss> if the playground is advertised on the website then maybe more than 1 person should be able to run it
17:03:26*krux02 joined #nim
17:09:19NimEventerNew post on r/nim by shujidev: How to override a method, see https://reddit.com/r/nim/comments/xiib6l/how_to_override_a_method/
17:12:37*disso_peach joined #nim
17:13:47*jmdaemon joined #nim
17:19:28FromDiscord<Kiloneie> When do you guys use inheritance over object variants ?
17:28:48FromDiscord<Phil> In reply to @Kiloneie "When do you guys": When using norm
17:29:50FromDiscord<Phil> The usecase there for making it inheritance was that you wanted to have some guarantees, those being that regardless of what fields you have, you must have an id field
17:30:25FromDiscord<Phil> So you needed something user-extendable in a package that had some base properties
17:30:44FromDiscord<pouriya.jamshidi> Does Nim have a built-in build system similar to `make`? I am aware of `nim script` but I am looking for something more generic.
17:33:54FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4aWS
17:37:23FromDiscord<Kiloneie> In reply to @Isofruit "The usecase there for": ... i don't understand how inheritance gives some guarantees. If i write equivalent code for inheritance and object variants, neither require you to have a field mandatory... unless there is a pragma for that ? and it only works with inheritance ?...
17:37:37FromDiscord<vestel> if object is used only by compileTime procs will it be included into resulting executable?
17:37:57FromDiscord<vestel> (edit) "procs" => "procs,"
17:39:05FromDiscord<Phil> In reply to @Kiloneie "... i don't understand": Oh no, I wasn't trying to say it so only inheritance can give you those guarantees, I was just trying to say that was a reason for choosing inheritance over e.g. not doing inheritance and telling the user that all their model types must have an id field and they need to add it themselves
17:39:15FromDiscord<Phil> (edit) "it so" => "that"
17:39:54FromDiscord<Phil> I haven't tried with object variants but I'd assume that they can't be really user-extended
17:40:27FromDiscord<auxym> In reply to @pouriya.jamshidi "Does Nim have a": you can define custom tasks, as well as pre/post hooks, in your nimble file
17:40:40FromDiscord<auxym> or you can just use make, depending on what you need
17:40:49FromDiscord<Phil> And in the case of models I don't think an object variant would even make any sense
17:41:22FromDiscord<Phil> Because if I had to write all my models as a single object variant the variant would be massive, like hundreds of lines of codes long just for the field definitions.
17:42:25FromDiscord<auxym> the reason is that in nim, the "build system" is integrated in the compiler. In C, what make was designed for, you need to call the compiler for each source file, then call the linker to link the object files created by the compiler. In Nim, the compiler takes care of compiling all your source files to C, then calling the c compiler and linker, all from a single nim call. @pouriya.jamshidi
17:42:51FromDiscord<Phil> In reply to @auxym "you can define custom": Ohhhh nimble tasks have pre/post hooks?
17:43:54FromDiscord<Phil> Just saw it in the docs, nice
17:44:07FromDiscord<auxym> yeah
17:44:29FromDiscord<auxym> esp useful is before/after build IMO.
17:45:11*hochata quit (Ping timeout: 268 seconds)
17:50:46FromDiscord<pouriya.jamshidi> In reply to @auxym "the reason is that": Thanks!
18:01:10FromDiscord<exelotl> In reply to @Kiloneie "... i don't understand": Use methods if you want unbounded polymorphism (can add new kinds of thing without having to go update a master list of things - useful if you're expecting to be adding new things all the time, or if you're making a library and want users to be able to make their own kinds). Otherwise use object variants.
18:02:17FromDiscord<exelotl> Oops this was supposed to be an answer to your original question, has nothing to do with guarantees :P
18:02:40FromDiscord<Kiloneie> Still a decent answer
18:03:07FromDiscord<Require Support> sent a long message, see http://ix.io/4aX2
18:04:14FromDiscord<Require Support> (edit) "http://ix.io/4aX2" => "http://ix.io/4aX3"
18:12:00FromDiscord<Phil> In reply to @auxym "you can define custom": You just triggered me rewriting the dozen or so bash scripts I have for building my app into nimble tasks with pre and post hooks :_D
18:12:02FromDiscord<Phil> (edit) ":_D" => "😄"
18:14:00FromDiscord<auxym> In reply to @Require Support "im fairly new to": you can run valgrind I think to detect memory leaks. but yeah if there's a leak in nim or the stdlib, definitely try and put together a minimal reproduction and open an issue
18:17:17FromDiscord<Forest [She/Her]> Is there a way to get rid of the terminator on a string?
18:17:42FromDiscord<Forest [She/Her]> I need to send it over a network (prefixed with the length) without the null terminator
18:30:09FromDiscord<auxym> on a cstring you mean? can you not just subtract 1 from the length when you are sending it (presumably you're passing a pointer and length or something like that)
18:42:43FromDiscord<Forest [She/Her]> On a normal Nim string
18:42:55FromDiscord<Forest [She/Her]> Since it included the null terminator by default, iirc
18:44:47FromDiscord<auxym> not to my knowledge? My understanding is that nim strings under the hood were mostly equivalent to `seq[char]`
18:45:48FromDiscord<auxym> doesn't matter anyways. your function that sends data over the network, it takes a pointer and length? just pass it `myString[0].addr, myString.len` and it should be fine
18:57:45FromDiscord<dlesnoff> Can I initialize an array with 500 zero values ?
18:59:08FromDiscord<dlesnoff> (edit) "?" => "(at declaration, without a for loop)?"
19:03:54FromDiscord<auxym> In reply to @Jiezron "Can I initialize an": `newSeqOfCap[int](500)` or in case you need anything else than zeros, see https://nim-lang.org/docs/sequtils.html#newSeqWith.t%2Cint%2Cuntyped
19:03:55FromDiscord<Forest [She/Her]> Ah fair
19:03:58FromDiscord<Forest [She/Her]> Thanks!
19:04:17FromDiscord<auxym> In reply to @auxym "`newSeqOfCap[int](500)` or in case": though that's just a template that expands to a for loop
19:04:35FromDiscord<vestel> In reply to @Jiezron "Can I initialize an": `zeroMem(unsafeAddr(x[0]), x.len sizeof(x[0])`
19:05:38FromDiscord<dlesnoff> In reply to @auxym "`newSeqOfCap[int](500)` or in case": that is faster to type and more readable ? Thanks
19:06:25FromDiscord<auxym> btw you said "array" but my answer was actually for seqs. are you familiar with arrays vs seqs in nim?
19:06:25FromDiscord<dlesnoff> In reply to @vestel "`zeroMem(unsafeAddr(x[0]), x.len * sizeof(x[0])`": That's a very C, low-level solution but should works indeed 😂
19:06:33FromDiscord<vestel> 🙂
19:06:47FromDiscord<dlesnoff> In reply to @auxym "btw you said "array"": yeah they are CT and constant-sized
19:06:53FromDiscord<auxym> for arrays, just `var arr: array[500, int]` will give you a zeroed array
19:06:59FromDiscord<dlesnoff> (edit) "are" => "exist at"
19:07:19FromDiscord<auxym> yeah and arrays are stack allocated, seqs allocate on the heap
19:08:16FromDiscord<auxym> nim always zeros memory when allocating a new variable
19:09:26FromDiscord<dlesnoff> I prefer to be explicit in general and tell it is zero-allocated to the program reader (just in case it isn't familiar with Nim)
19:10:47FromDiscord<auxym> you do you, use the zeroMem as suggested by vestel I guess.
19:11:15FromDiscord<Forest [She/Her]> Would defining a proc with the name `[]` allow me to do `myObj[index]`?
19:11:46FromDiscord<auxym> on another topic, anyone has info on how macros-within-macros are handled? or templates in macros? is it possible to expand the "inner" macros first?
19:11:51FromDiscord<auxym> In reply to @Forest "Would defining a proc": yes
19:12:53FromDiscord<vestel> In reply to @auxym "on another topic, anyone": https://nim-lang.org/docs/manual.html#macros
19:13:34FromDiscord<Forest [She/Her]> In reply to @auxym "yes": Thanks!
19:14:44FromDiscord<auxym> you can also define `[]=` to be able to do `myObj[index] = (...)`
19:17:14FromDiscord<Forest [She/Her]> Oh neat, thanks!
19:18:02FromDiscord<Forest [She/Her]> I've decided to just return a reference to the underlying sequence anyway, since idk how else to make it modifiable, i don't think i can return a `var seq[JavaBasePacket]`
19:18:26FromDiscord<Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4aXz
19:18:49FromDiscord<auxym> In reply to @vestel "https://nim-lang.org/docs/manual.html#macros": right so macros are expanded outside-first. hm, this is messing with my plans 😒
19:19:27FromDiscord<vestel> afaik you can return call to macro as AST statement
19:19:34FromDiscord<vestel> not sure why you need it tho
19:22:22FromDiscord<Forest [She/Her]> Is the object inside of a reference mutable even if i do `let`?
19:23:33FromDiscord<vestel> no
19:23:55FromDiscord<Forest [She/Her]> Alright then thanks
19:24:07FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4aXD
19:24:16FromDiscord<Forest [She/Her]> In reply to @jmgomez "are you doing a": Nope
19:24:39FromDiscord<Forest [She/Her]> Making a Minecraft Java Edition server implementation (with plans of perhaps making native support for Bedrock)
19:25:11FromDiscord<jmgomez> oh ok! Nim to bytecode would be cool though
19:25:42FromDiscord<Forest [She/Her]> In reply to @jmgomez "oh ok! Nim to": I'm actually working on that too, just my ADHD being a bitch so working on something else for now
19:28:07FromDiscord<jmgomez> Gotcha! Not a Java dev myself (I used to code in .NET back in the day) but Nim to java can be a big deal for Nim. It's probably the biggest community willing to try new langs
19:32:36FromDiscord<Forest [She/Her]> Yeah absolutely, and ik that people in general are annoyed with how Java looks and works, and Kotlin has been a deterrent for others even with people's claims of it being great
19:32:52FromDiscord<Forest [She/Her]> Nim doesn't feel like a JVM lang, and this ideally wouldn't change that much
19:36:54FromDiscord<Forest [She/Her]> In reply to @jmgomez "Gotcha! Not a Java": I think an issue that'll probably have to be solved is the stdlib and the built-in system stuff
19:37:44FromDiscord<Forest [She/Her]> Since ideally everything would just work™️ once i get the semantics to translate, but i doubt it would work like that, so may have to fill a lot of libraries specifically for Nim on the JVM
19:46:05FromDiscord<auxym> so basically I'm trying to achieve something like this with a macro:
19:46:23FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4aXJ
19:47:01FromDiscord<auxym> so, stuff mutiple nodes in the middle of existing child nodes, at the same AST level. is that possible?
19:52:09FromDiscord<jmgomez> In reply to @Forest "I think an issue": I mean the stdlib can be just rewritten for it, right? Is not that much and probably having the signature can be automatized
19:52:32FromDiscord<jmgomez> (edit) removed "Is not that much and probably having the signature can be automatized"
19:56:19FromDiscord<Forest [She/Her]> In reply to @jmgomez "I mean the stdlib": It can yeah, but that's a big task
20:02:42*krux02 quit (Remote host closed the connection)
20:07:18NimEventerNew thread by auxym: Return multiple "flat" nodes from a macro, see https://forum.nim-lang.org/t/9480
20:11:02FromDiscord<huantian> In reply to @Forest "Is the object inside": Yeah refs are always mutable
20:18:01FromDiscord<jmgomez> In reply to @Forest "It can yeah, but": yeah, it is. But smaller than having it compiling to bytecode. Is there a repo or something of what you have so far?
20:18:04*hochata joined #nim
20:25:55FromDiscord<Forest [She/Her]> In reply to @jmgomez "yeah, it is. But": Fair
20:26:21FromDiscord<Forest [She/Her]> Yeah there's a repo, here: https://github.com/Mythical-Forest-Collective/Nimpiler
20:26:30FromDiscord<Forest [She/Her]> I'm working on it again rn
20:27:04FromDiscord<Forest [She/Her]> It's using a fork of Nim meant to make it easier to maintain the existing backends and make new ones
20:42:35FromDiscord<Forest [She/Her]> Oh yeah, and i need to work on something to wrap Java packages into a Nim 'package' that just emits the Jasmin code directly
20:43:03FromDiscord<Forest [She/Her]> (Jasmin is a low-level human read and writable format for it)
20:45:24*LuxuryMode joined #nim
20:50:48FromDiscord<Forest [She/Her]> Is there a reliable way to invoke the JVM? I need to run a jar file but running through OS seems like a bit of a hell for different platforms
20:53:43FromDiscord<David> Forest is this what you're looking for\: https://github.com/yglukhov/jnim ?
20:55:14FromDiscord<Forest [She/Her]> It should be fine yeah, thanks!
20:55:21FromDiscord<David> If you are directly invoking a JVM to run Jasmin I would encourage taking a peak at either https://asm.ow2.io or https://bytebuddy.net/#/
20:56:09FromDiscord<David> Jasmin hasn't been updated in years and asm is the standard JVM bytecode manipulation library. Bytebuddy is slower, but it's much simpler wrapper built on top of asm.
21:00:04FromDiscord<Forest [She/Her]> In reply to @David "If you are directly": Ah no that's not what I'm doing
21:00:52FromDiscord<Forest [She/Her]> What i'm doing is taking Nim's source code (from the AST) and attempting to compile it to Jasmin, and i want to invoke the Jasmin compiler to compile the source code
21:06:43FromDiscord<David> Any particular reason you're going that route over outputting java directly? You are still introducing a new compilation step and the Jasmin compiler is unsupported from what I can tell. There are probably a lot more resources to debug your generated Java source code than an esoteric assembler.
21:07:30FromDiscord<David> Either way good luck!
21:15:14FromDiscord<Elegantbeef> Without strict funcs 😛↵(@huantian)
21:15:22FromDiscord<huantian> true!
21:16:30FromDiscord<Elegantbeef> Make a `&` operator for arrays then you can do `@([2, 3, 4] & manyItems() & 5)`↵(@auxym)
21:19:34FromDiscord<David> @Forest [She/Her]\: Sorry one last thing to keep in mind is the source map debugging spec in JSR-45. This may not be possible with Jasmin.
21:23:57*neceve quit (Quit: ZNC - https://znc.in)
21:24:33FromDiscord<John Fred> sent a long message, see http://ix.io/4aGV
21:24:49FromDiscord<Kiloneie> oO
21:25:38FromDiscord<Patitotective> In reply to @John Fred "Do you have a": <@&371760044473319454> ❤️
21:25:42*neceve joined #nim
21:26:45FromDiscord<Elegantbeef> Imagine being paid to spam a url no one clicks in a programming matrix
21:26:50FromDiscord<Elegantbeef> Fucking top tier waste of money
21:27:23FromDiscord<Kiloneie> Ever seen a milk ad when watching a gaming stream ? lol. Anyways off topic.
21:30:01FromDiscord<Kiloneie> Is Nim Forum ever getting a dark mode ?
21:30:18FromDiscord<Elegantbeef> PRs welcome
21:32:23FromDiscord<David> image.png↵(@Kiloneie) https://media.discordapp.net/attachments/371759389889003532/1021534242641018882/image.png
21:32:37FromDiscord<David> @Kiloneie\: https://darkreader.org/ is pretty decent ^
21:33:17FromDiscord<Kiloneie> I think i have a dark theme on firefox, but not this... This will be amazing, thank you
21:34:01FromDiscord<Patitotective> forum get a new style along with nimble directory, would be cool
21:35:32FromDiscord<Kiloneie> Browser extensions are such life savers, especially YT background play fix for phones, they charge money for that...
21:35:59FromDiscord<Elegantbeef> Though sometimes the bridge shits the bed and matrix goes dark 😛
21:36:00FromDiscord<Elegantbeef> I mean emojis
21:36:00FromDiscord<Elegantbeef> Even discord custom reactions reach us
21:36:00FromDiscord<Elegantbeef> Reactions are not bridged
21:48:48FromDiscord<auxym> In reply to @Elegantbeef "Make a `&` operator": yeah, I have another workaround that involves more AST manipulation, seems that's what I'll have to do
21:52:18FromDiscord<Elegantbeef> You could also just make a macro that iterates it's elements an joins them with `&` but meh
21:56:34FromDiscord<Kiloneie> Whats the benefit of using strictFuncs ?
21:56:55FromDiscord<Elegantbeef> The functions are properly pure
22:10:09*qwr quit (Ping timeout: 250 seconds)
22:22:11*qwr joined #nim
22:53:14*arkurious quit (Quit: Leaving)
23:04:44FromDiscord<retkid> whats that function which echos the repl of a string
23:04:50FromDiscord<retkid> byte for byte
23:05:07FromDiscord<retkid> im having one of those classic string assertions wrong for inexplicable reasons
23:05:11FromDiscord<retkid> and i need to see whats happening
23:05:57FromDiscord<! Nilts> How would i capitalize in nim?
23:06:08FromDiscord<retkid> toCapitapleAscci
23:06:11FromDiscord<retkid> or however you spell it
23:06:17FromDiscord<retkid> its in string utils
23:06:42FromDiscord<Patitotective> In reply to @not logged in "How would i capitalize": strutils.toUpperAscii
23:06:58FromDiscord<Patitotective> nvm
23:07:04FromDiscord<retkid> haha nerd
23:07:07FromDiscord<retkid> i used this proc yesterdayt
23:07:08FromDiscord<retkid> (edit) "yesterdayt" => "yesterday"
23:07:20FromDiscord<Patitotective> its capitalizeAscii
23:07:26FromDiscord<retkid> shit
23:07:51FromDiscord<Elegantbeef> repr?↵(@retkid)
23:08:25FromDiscord<retkid> it i
23:08:28FromDiscord<retkid> it is repr
23:08:29FromDiscord<Patitotective> !eval echo repr "Hello\nWorld"
23:08:43FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/1021558483696504893/unknown.png
23:08:46FromDiscord<retkid> estrange
23:09:29NimBotCompile failed: <no output>
23:09:44FromDiscord<Patitotective> nimbot doesnt work anymore, does it
23:10:37FromDiscord<retkid> hmmm
23:10:42FromDiscord<Elegantbeef> Uses playground api
23:10:43FromDiscord<retkid> im not understanding this
23:10:47FromDiscord<Elegantbeef> What's your full code ret
23:11:27FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=4aYm
23:11:38FromDiscord<retkid> .q. != .q.
23:11:57FromDiscord<retkid> hmmm
23:12:11FromDiscord<retkid> i think theres unprintable characters between them
23:14:39FromDiscord<Elegantbeef> `toOpenArrayByte(0, buffer.high)` might help
23:14:46FromDiscord<Elegantbeef> It'll show you the byte data of the string
23:15:15FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/1021560128417308722/unknown.png
23:15:17FromDiscord<retkid> ye
23:15:23FromDiscord<retkid> its infested with null
23:15:45FromDiscord<retkid> is there a null check proc
23:15:51FromDiscord<retkid> so i can filter
23:16:20FromDiscord<Elegantbeef> It's just a character so yes
23:16:48FromDiscord<retkid> In reply to @Elegantbeef "It's just a character": ?!?
23:16:58FromDiscord<Elegantbeef> `\0` is just a character
23:17:02FromDiscord<retkid> yes
23:17:06FromDiscord<Elegantbeef> Like what is so confusing
23:17:11FromDiscord<retkid> what isn't here
23:17:24FromDiscord<retkid> oh i see
23:17:31FromDiscord<retkid> i don't know what didn't click
23:20:52FromDiscord<retkid> why doesn't filter on a string return a string
23:21:11FromDiscord<retkid> it should return the T inputed
23:24:33FromDiscord<Elegantbeef> Cause it uses openarray[char]
23:24:45FromDiscord<Elegantbeef> `str.replace("\0")` is what you want
23:25:09FromDiscord<Elegantbeef> But in all honesty i think if you have to remove `\0` from the stream you're doing it wrong
23:25:26FromDiscord<retkid> temporary solution
23:25:38FromDiscord<retkid> until i think of something better
23:25:48FromDiscord<Elegantbeef> Read the 32bit integers like you're supposed to?
23:26:11FromDiscord<retkid> which ones
23:26:29FromDiscord<Elegantbeef> `2000` `4200` `4000` `3000` `46113560` I'm not an expert but those seem to be 32bit integers
23:26:47FromDiscord<retkid> oh
23:27:09FromDiscord<retkid> 😓
23:27:22FromDiscord<retkid> my brain is off
23:27:29FromDiscord<retkid> it should be one 32bit into though
23:27:34FromDiscord<Elegantbeef> I mean atleast i think those are 32bit integers
23:27:37FromDiscord<retkid> they have to be
23:27:56FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/1021563319301185628/unknown.png
23:28:01FromDiscord<retkid> right now im trying to figure htis out
23:28:16FromDiscord<Elegantbeef> I dont know what this is
23:28:31FromDiscord<retkid> im suppose to be sending 2 strings
23:28:35FromDiscord<retkid> "42" ".q."
23:28:38FromDiscord<! Nilts> `toUpperAscii` is char?
23:28:47FromDiscord<retkid> yes
23:30:41FromDiscord<Elegantbeef> If you're sending `42` and `.q.` you shoulf get `42` and `.q.`
23:32:11FromDiscord<retkid> might switch to fifo
23:33:18FromDiscord<retkid> current idea
23:33:27FromDiscord<retkid> !headermarker!sizeofmessage!
23:33:35FromDiscord<Elegantbeef> You confuse me
23:33:44FromDiscord<retkid> whys that
23:33:56FromDiscord<Elegantbeef> What are you trying to do?
23:34:00FromDiscord<retkid> i dont know
23:34:11FromDiscord<Elegantbeef> Ok
23:34:38FromDiscord<Elegantbeef> So then why are you writing socket code
23:40:11FromDiscord<Bung> https://github.com/nim-lang/Nim/issues/7955 this expected all failed right ?
23:53:41FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/1021569803120549918/unknown.png
23:53:42FromDiscord<retkid> orkthi
23:53:49FromDiscord<retkid> his works
23:53:55FromDiscord<retkid> this works
23:54:06FromDiscord<retkid> but its probably pretty slow
23:54:14FromDiscord<retkid> eh its fine