<< 19-10-2021 >>

00:11:52*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
00:12:06*Gustavo6046 joined #nim
00:41:14*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
00:41:40*Gustavo6046 joined #nim
01:08:51*Gustavo6046 quit (Ping timeout: 245 seconds)
01:09:29*Gustavo6046 joined #nim
01:21:58*neurocyte0132889 quit (Ping timeout: 265 seconds)
01:29:43*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
01:30:01*Gustavo6046 joined #nim
01:34:31*Gustavo6046_ joined #nim
01:35:06*Gustavo6046 quit (Ping timeout: 245 seconds)
01:37:50*Gustavo6046_ is now known as Gustavo6046
01:43:40*Egeon joined #nim
01:48:53*arkurious quit (Quit: Leaving)
02:40:02*Gustavo6046_ joined #nim
02:40:06*Gustavo6046 quit (Ping timeout: 245 seconds)
02:42:02*Gustavo6046_ is now known as Gustavo6046
02:45:50*Gustavo6046 quit (Excess Flood)
02:54:42*Gustavo6046 joined #nim
02:58:19*Gustavo6046 quit (Read error: Connection reset by peer)
03:01:38*Gustavo6046 joined #nim
03:08:05*Gustavo6046 quit (Read error: Connection reset by peer)
03:12:25*Gustavo6046 joined #nim
03:18:39*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
03:19:10*Gustavo6046 joined #nim
03:36:31*Gustavo6046 quit (Read error: Connection reset by peer)
03:39:05*Gustavo6046 joined #nim
03:45:56*euantorano quit (Ping timeout: 245 seconds)
03:46:21*notchris quit (Ping timeout: 245 seconds)
03:46:35*LyndsySimon quit (Ping timeout: 264 seconds)
03:47:19*euantorano joined #nim
03:49:45*LyndsySimon joined #nim
03:59:34*Gustavo6046 quit (Ping timeout: 252 seconds)
04:00:39*Gustavo6046 joined #nim
04:00:40*Gustavo6046 quit (Client Quit)
04:00:50*notchris joined #nim
04:01:45*Gustavo6046 joined #nim
04:06:01*supakeen quit (Quit: WeeChat 3.3)
04:06:30*supakeen joined #nim
04:07:39*rockcavera quit (Remote host closed the connection)
04:22:40*Gustavo6046 quit (Ping timeout: 252 seconds)
04:22:49*Gustavo6046_ joined #nim
04:26:09*Gustavo6046_ is now known as Gustavo6046
05:08:26EgeonAnyone know what is wrong with this? https://play.nim-lang.org/#ix=3Cbu
05:09:54FromDiscord<impbox [ftsf]> other than the error message?
05:11:26EgeonIt is not a complete code, but the first output shouldnt be 16 but 80, coded for "P" in ASCII
05:11:42FromDiscord<impbox [ftsf]> "it looks like you're trying to write malware"
05:12:07Egeonnah
05:13:05EgeonAre you helping?
05:13:47FromDiscord<Rika> Hard to help, what is the definition of the shell code variable
05:13:49FromDiscord<impbox [ftsf]> nah
05:13:50FromDiscord<Rika> What type
05:14:06FromDiscord<impbox [ftsf]> you can figure out how to write malware without help
05:14:19Egeonbyte array
05:14:29FromDiscord<Rika> Array or seq
05:14:36FromDiscord<Rika> You cannot cast arrays to string
05:14:47FromDiscord<Rika> Different structure
05:14:50Egeonfixed byte array not seq
05:15:01FromDiscord<Rika> Well then there’s the first issue
05:16:17EgeonI do it just fine on line 11 the assert went through
05:17:36FromDiscord<Rika> Probably coincidence, I am certain that is UB
05:17:47FromDiscord<Rika> Rather not UB but incorrect logic
05:19:38FromDiscord<Rika> Ah I see
05:19:49FromDiscord<Rika> The slice index returns a sequence
05:19:55FromDiscord<Rika> So the cast works for the first part
05:20:05EgeonWhat is UB?
05:20:21Egeonaha I see
05:21:45FromDiscord<Rika> On the second part, use `cast[PeHeader](shellcode[pe..pe+sizeof(PeHeader)-1].addr)` I think will work
05:22:39EgeonSo I should replace the slice to some other function to return a pure byte array. What'd you recommend?
05:25:32EgeonOK ty! you dint answer what is UB? I saw it mentioned twice yesterday and just now and I'm curious.
05:27:19FromDiscord<Elegantbeef> Undefined behaviour
05:27:47FromDiscord<Elegantbeef> Logic that may depend on the compiler or architecture you're using
06:07:44FromDiscord<Schelz> hi, how should I write the args if i want to compile the nim script as dll and enable ssl support
06:07:45FromDiscord<Schelz> ?
06:08:55FromDiscord<Schelz> I know that for ssl its "-d:ssl" but how do i add the second one
06:11:02FromDiscord<Elegantbeef> I assume you dont actually mean nimscript, but nim, i beleive it should be `--app:lib` i could be wrong
06:12:21FromDiscord<Elegantbeef> you may need `--noMain:on` aswell
06:15:02FromDiscord<Schelz> and for multiple args for -d its like this ? https://media.discordapp.net/attachments/371759389889003532/899903447367823410/unknown.png
06:15:37FromDiscord<Elegantbeef> nope you just do more `-d:`s
06:15:55FromDiscord<Schelz> aha ok, thx
06:16:00FromDiscord<Elegantbeef> `nim c -d:ssl -d:useNimRtl --app:lib --noMain:on main.nim`
06:16:31FromDiscord<Elegantbeef> You can of course make a `config.nims` and define all of these behind a single switch
06:17:29FromDiscord<Schelz> got it work thx
06:25:26FromDiscord<Schelz> and one last question how do I compile it for x86 architecture
06:26:18FromDiscord<Elegantbeef> `--cpu:i386` i believe
06:26:33FromDiscord<Elegantbeef> Though x86 is ambiguous
06:26:37FromDiscord<Elegantbeef> Just assume you mean 32bit
06:26:47FromDiscord<Schelz> yep
07:05:47*PMunch joined #nim
08:04:34*PMunch quit (Remote host closed the connection)
08:05:14*PMunch joined #nim
08:27:50FromDiscord<Varriount> @Araq I'm still skeptical regarding `Isolated[T]`'s flexibility. Even if it works, that doesn't necessarily mean it will have low-enough friction to be useful.
08:28:52FromDiscord<Varriount> This is mostly based off my observations of the `spawn` mechanism.
08:29:36FromDiscord<Varriount> (which seems to operate on a similar premise)
08:48:22FromDiscord<narimiran> Nim 1.6 is out!! https://nim-lang.org/blog/2021/10/19/version-160-released.html
08:49:07NimEventerNew thread by Miran: Nim 1.6 is out!!, see https://forum.nim-lang.org/t/8511
08:58:31FromDiscord<exelotl> aaaaaaaa congrats
09:00:34PMunchNeat!
09:06:32PMunchThis is a nice blurb: A practical, compiled systems programming language offering C++-like perfomance and portability, Python-like syntax, Lisp-like flexibility, strong C, C++, JS, Python interop, and best-in-class metaprogramming.
09:08:29FromDiscord<impbox [ftsf]> woo! congrats
09:08:45PMunchHmm, iterable[T], is that any type which has an `items` iterator? Is there a iterable[T, K] which has a `pairs` iterator?
09:08:51mstyah, neat blurb indeed
09:08:56PMunchIs there a miterator[T] for mutables?
09:09:48PMunchAh duh, it's all explained further down..
09:10:16FromDiscord<impbox [ftsf]> "deprecated a number of error prone or redundant features"
09:10:44FromDiscord<impbox [ftsf]> doesn't seem to be much detail on this
09:11:20PMunchWell, the iterator section didn't answer any of my questions :P
09:11:41PMunchSo is iterable only to take an iterator?
09:12:43FromDiscord<impbox [ftsf]> lets you pass iterators to things
09:13:53PMunchAha, so you can do `sum(mySeq.items)` it seems, and `sum(mySeq.pairs)` where T would be a key/value tuple
09:13:58PMunchThat's pretty cool!
09:15:58FromDiscord<Rika> Cool
09:17:54*rockcavera joined #nim
09:17:55*rockcavera quit (Changing host)
09:17:55*rockcavera joined #nim
09:46:23FromDiscord<haxscramper> compiler explorer PR done
09:46:55FromDiscord<haxscramper> and someone submitted release notes on hackernews already
09:58:29FromDiscord<Schelz> how can i make in nim a for loop range
09:58:41FromDiscord<Schelz> ex in python for i in range(0, 23)
09:58:48FromDiscord<enthus1ast> for idx in 0..10\:
09:58:52FromDiscord<haxscramper> `for i in 0 ..< 23`
09:58:52FromDiscord<Schelz> (edit) "i" => ""i" | "23)" => "23)""
09:58:59FromDiscord<Schelz> thx
10:16:43*Vladar joined #nim
10:33:54FromDiscord<tandy> is there a way to print tables nicely?
10:34:31FromDiscord<pointystick> Try this: https://github.com/xmonader/nim-terminaltables
10:38:22FromDiscord<tandy> ty
10:38:37FromDiscord<tandy> also is there a way to create a HttpHeaders object from a table?
10:39:41*Egeon quit (Ping timeout: 245 seconds)
10:40:14*Egeon joined #nim
10:44:53FromDiscord<tandy> omg why are httpheaders so fucked
10:45:13FromDiscord<tandy> https://github.com/nim-lang/Nim/issues/12211
10:46:35mstoh, what a tangled web we weave
10:47:51mst...
10:47:52mst> btw, writing "thou" and "shalt" in an issue makes me skip over what you've written.
10:47:56*mst sulks
10:50:32msttandy, without diminishing how bloody annoying this is, IME practically every http header implementation in every language starts off underestimating just how ridiculous HTTP in the wild will turn out to be and how much "fun" that's going to end up being in the long run
10:51:21mstgenerally when you find one that -does- manage to handle all this stuff, it either means the implementation got there the hard way years ago, or the implementor got there the hard way on a previous attempt somewhere
10:52:46FromDiscord<tandy> lol i bet↵(<@709044657232936960_mst=5b=49=52=43=5d>)
10:56:05FromDiscord<tandy> ok i switched back to using seq[(string, string)]
10:58:41FromDiscord<Rika> btw `{"key": "val"}` is `seq[(string, string)]`
10:58:45FromDiscord<pointystick> sent a code paste, see https://play.nim-lang.org/#ix=3Ccv
10:59:55PMunchAnother option for printing tables: https://github.com/PMunch/nancy
11:00:07FromDiscord<haxscramper> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/collections/tables.nim#L301 you can just copy this for tableref
11:00:13FromDiscord<tandy> do you have a way of going from headers to seq again?↵(@pointystick)
11:00:16FromDiscord<haxscramper> and technically `@{}` is a `seq`, `{}` is an array.
11:01:01*Vladar quit (Ping timeout: 258 seconds)
11:01:06FromDiscord<Rika> ah i see
11:01:08FromDiscord<Rika> forgot
11:01:09FromDiscord<Rika> lol
11:01:16FromDiscord<Rika> tandy: "blah.pairs.toSeq"
11:01:24FromDiscord<Rika> oh headers
11:01:25FromDiscord<Rika> wait here
11:01:31FromDiscord<tandy> nvm
11:01:36FromDiscord<Rika> headers.pairs.toSeq xddddd
11:01:41FromDiscord<tandy> lol
11:01:42PMunchHttpHeaders have a tables field which is the internal table
11:03:00FromDiscord<tandy> oh shit
11:03:07FromDiscord<tandy> i just remebered again why i started using tables
11:03:17FromDiscord<tandy> i cant index a seq by a []
11:03:42FromDiscord<Rika> lol
11:03:44FromDiscord<Rika> you can
11:03:47FromDiscord<Rika> not with strings
11:03:48FromDiscord<Rika> hehe
11:03:49FromDiscord<soupayan> is nim a transpiler?
11:03:53PMunchNo
11:03:53FromDiscord<Rika> no
11:03:59FromDiscord<tandy> ok so i dont need to convert the response headers
11:04:06FromDiscord<tandy> il keep those as a tableref
11:05:01FromDiscord<soupayan> nim in action says that nim converts to c code and then compiles
11:05:10FromDiscord<Rika> yes
11:05:12PMunchThat's it, I'm writing an article about this "Is Nim a transpiler nonsense"..
11:05:12FromDiscord<Rika> that does not make it a transpiler
11:05:15mstthe concept of 'transpiler' is fuzzy and not really worth thinking about
11:05:21FromDiscord<Rika> C converts to asm and then assembles
11:05:35FromDiscord<Rika> PMunch: you are god
11:05:49PMunchHaha, I'm just tired of answering the same question over and over again :P
11:05:53mste.g. rustc goes via LLVM IR as it compiles
11:06:05mstPMunch: that's pretty much the impetus for all my best articles
11:06:09FromDiscord<Rika> just call it a compiler man theres no meaningful difference
11:06:11mstPMunch: Frequently Delivered Answers
11:06:50mstand honestly I find C a much easier to debug IR than LLVM's is ;)
11:06:52FromDiscord<haxscramper> I was away for ten god damn minutes and we are back to transpiler
11:06:52FromDiscord<retkid> do you guys use sugar often? This stuff looks useful but im afraid it might reduce readability
11:06:54FromDiscord<soupayan> ok.. i was just confused.. did not mean to step on anything 😋
11:07:04FromDiscord<Rika> its okay
11:07:05FromDiscord<tandy> ree↵(@Rika)
11:07:14FromDiscord<Rika> In reply to @retkid "do you guys use": for me, no
11:07:18FromDiscord<haxscramper> `collect` is good, does not reduce readability. everything else is up to debate↵(@retkid)
11:07:19FromDiscord<haxscramper> also `std/with`
11:07:21FromDiscord<Rika> i prefer `proc(): =` over `=>`
11:07:35FromDiscord<haxscramper> IMO it should be in sugar, but it is super useful for multiple calls over the same object
11:07:39FromDiscord<Rika> i'm still not used to using collect but i intend to migrate
11:07:44PMunch@soupayan, oh not at all. It's just a question we get asked quite often, and one which some people have very strong feelings about
11:07:45mstsoupayan, basically, the term 'transpiler' can mean lots of things, sometimes descriptive, sometimes insulting, almost always less useful than being explicit
11:07:58FromDiscord<Rika> `std/with` sounds good, alsto thinking of trying it out
11:08:16mstit's one of those words I honestly kinda wish nobody had ever come up with
11:08:29FromDiscord<retkid> I like filter() (i know its in sequtils but its kinda sugar adjacent) but its syntax is a little bit weird
11:08:31FromDiscord<soupayan> In reply to @mst "<@846808276557234176>, basically, the term": yes, i agree..
11:08:32PMunch@retkid, I use sugar once in a while. But mostly for `() =>`
11:08:45FromDiscord<Rika> In reply to @retkid "I like filter() (i": nah its fairly standard with functional programming
11:08:52PMunchTo be honest I just haven't checked out the module in a while and I tend to forget it's there :P
11:09:09FromDiscord<retkid> I've yet to learn a functional lang
11:09:28FromDiscord<Rika> i learned some basic haskell and i actually liked it a bit
11:09:40PMunch`dump` is also pretty nice, but I always forget about it..
11:09:50FromDiscord<Rika> what's dump?
11:10:03FromDiscord<Rika> is that like `&"{variable=}"`?
11:10:19FromDiscord<haxscramper> If dup wasn't so dysfunctional it could be used more often as well
11:10:30mstI learned enough scheme back in 2003 or so to embed guile into another program to give me async/await like semantics in the top level control flow of a callback based async I/O system by (ab)using call/cc
11:10:43mstthat was good fun, though possibly only if you're me
11:10:44PMunch@retkid, I highly recommend learning one, I read Clojure for the Brave and True and it's a great way to learn both about functional languages, but also just thoroughly enjoyable
11:11:06PMunch@haxscramper, why is dump dysfunctional?
11:11:08FromDiscord<retkid> yea Clojure looks kinda insane to me
11:11:08FromDiscord<Rika> dup is dysfunctional? damn how
11:11:17PMunchOh dup :P
11:11:19FromDiscord<Rika> pmunch: he said dup
11:11:21FromDiscord<Rika> xd
11:11:26NimEventerNew thread by Puruneko: Strange-like behavior in openArray in multiple types, see https://forum.nim-lang.org/t/8512
11:11:31FromDiscord<retkid> when i was learning JVM langs I looked at scala and basically shat myself
11:11:42PMunchClojure is just pure joy
11:11:46PMunchSuch a nice language
11:12:11FromDiscord<retkid> after im done with this project i was thinking about learning Racket
11:12:14mstretkid, I had much the same reaction to the syntax and, uh, for calibration, I willingly write a lot of perl
11:12:32FromDiscord<Rika> functional languages fit how i think somewhat
11:12:34FromDiscord<Rika> its really fun
11:14:02FromDiscord<haxscramper> It is dysfunctional because most of the stdlib does not account for it (there are almost no in-place things for strutils). Also, it cannot parse `discard procThatReturnsAndMutates()` and it was kind of problematic
11:14:19*Vladar joined #nim
11:15:36FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3CcE
11:26:54FromDiscord<tandy> [leorize](https://matrix.to/#/@leorize:envs.net)\: im about to start writing a jsony de/serialiser for union
11:28:14mstI'm guessing you mean json-ish ?
11:28:48*mst only asks cos ingy (author of YAML) and I actually wrote something called JSONY a few years back for JSON-like config files ;)
11:30:12mst(basically "JSON but with most of the syntax optional, so your configs were nice and easy to write but you could trivially paste/template in a chunk of actual JSON and that would parse as part of the document too, a number of sysadmins quite liked it for small things)
11:35:24FromDiscord<tandy> haha no, im talking about https://github.com/treefrom/jsony↵(<@709044657232936960_mst=5b=49=52=43=5d>)
11:37:09FromDiscord<tandy> that should be https://github.com/treeform/jsony
11:41:55FromDiscord<Jonah> what's the best way to automatically print the json node when doing `node.to(Struct)` errors? i'm trying to improve the crash messages from bad json data with the stdlib json library
11:42:59FromDiscord<Rika> catch the error, print the node, reraise the error
11:45:34FromDiscord<Jonah> do i have to just duplicate that code on every parse then
11:45:37FromDiscord<tandy> In reply to @tandy "[leorize](https://matrix.to/#/@leorize:envs.net)\: ": @treeform would you have any interest in me making a PR for this?
12:00:00FromDiscord<retkid> In reply to @tandy "[leorize](https://matrix.to/#/@leorize:envs.net)\: ": is marshal not good enough for you
12:00:20FromDiscord<retkid> marshal: am i joke to you
12:01:14PMunchmst, that actually sounds pretty interesting. Do you have a link to the project?
12:02:12mstp3rl.org/JSONY is the implementation we put together
12:02:47mstnote that it's using a PEG grammar under the hood to be easy to port to other stuff, but I dunno if anybody did
12:04:30FromDiscord<tandy> marshal is slow and not flexible, also i think jsony support more type features↵(@retkid)
12:04:53FromDiscord<retkid> marshal has treated me well
12:05:07FromDiscord<retkid> however i have not had more than like 8 mb
12:05:29FromDiscord<retkid> sorry its 16 mb
12:05:52FromDiscord<retkid> are you sure its not a disk limit @tandy
12:05:57FromDiscord<retkid> In reply to @tandy "marshal is slow and":
12:06:01*supakeen quit (Quit: WeeChat 3.3)
12:06:31*supakeen joined #nim
12:06:47FromDiscord<Rika> ? where was disk limits mentioned
12:07:23PMunchHmm, I wonder what would happen if I ran Futhark on the C code generated by Nim :P
12:14:41NimEventerNew post on r/nim by trustable-code: Nim version 1.6.0 released, see https://reddit.com/r/nim/comments/qba84c/nim_version_160_released/
12:17:02*rockcavera quit (Remote host closed the connection)
12:17:41PMunch@Rika, @mst, @soupayan: https://peterme.net/is-nim-a-transpiler.html
12:19:25mstPMunch: coffeescript is probably the single most central example
12:23:46FromDiscord<narimiran> @PMunch nice article! i predict this one to be shared even more than the object vs ref object one 🙂
12:25:06FromDiscord<haxscramper> good
12:25:06FromDiscord<haxscramper> good article\
12:26:19PMunch@mst, I tried to use examples who actually referred to themselves as transpilers
12:27:12PMunchBut yeah, coffeescript will probably fall under most peoples definition
12:27:29FromDiscord<haxscramper> it it possible to dump LLVM IR from clang?
12:27:39FromDiscord<haxscramper> IIRC it is still somewhat readable
12:27:59FromDiscord<haxscramper> Can be used as an example of abstraction level drop for cxx for example
12:28:22PMunch@narimiran, this one? https://peterme.net/nim-types-originally-a-reddit-reply.html
12:28:38FromDiscord<narimiran> yeah
12:29:01mstPMunch: you mean like https://coffeescript.org/#transpilation
12:29:21mstPMunch: oh, shit, it's calling *babel* a transpiler, sorry, misread
12:30:02mstPMunch: I'm about 98% sure that I first encountered the term transpiler because it gained popularity being used to describe coffeescript, but fair point about the self-description
12:30:12PMunchHaha, I like how Babel has in big bold yellow letters at the top of their page "Babel is a JavaScript compiler."
12:30:17PMunchSo yeah, flexible term .P
12:30:20mst*LOL*
12:30:37mst'transpiler, n.: somebody else's compiler'
12:30:45PMunchHaha, exactly!
12:37:55PMunch@mst, added some notes about Babel and CoffeeScript and just had to throw that definition in there. Let me know if you want me to change the attribution
12:38:15FromDiscord<el__maco> aren't most (new) compilers transpilers these days. They transpile to LLVM's IR don't they
12:38:33PMunchDid you read the article?
12:38:40FromDiscord<haxscramper> `nuclear.jpg`
12:38:44mstPMunch: fine by me :D
12:39:10FromDiscord<el__maco> which article?
12:39:27FromDiscord<haxscramper> https://peterme.net/is-nim-a-transpiler.html
12:39:46PMunchThe definition is kinda floating. By loosest of definitions then yes compiling to LLVM's IR is a transpilation. But for the term to actually be useful it's not a very good way to use the term
12:40:28mstI think your "level of abstraction" heuristic is pretty good, in so far as the term is useful at all
12:41:54FromDiscord<el__maco> yeah idk, the article seems to have a point but its mostly about semantics and arguing about semantics is rarely very worthwhile it would feel like
12:41:59PMunchWell the problem (as I note in the penultimate section) is that no two languages are exactly the same, so determining the "level of abstraction" isn't exactly trivial
12:42:27PMunch@el__maco, when talking about terms semantics is pretty much the only thing you can argue
12:42:52FromDiscord<narimiran> "arguing about semantics is rarely very worthwhile" - and here we are, throwing transpiler left and right
12:43:12FromDiscord<haxscramper> sent a long message, see http://ix.io/3Cd1
12:43:32FromDiscord<haxscramper> none of these arguments make any sense for a person who wrote any meaningful amount of nim code, or bothered to read the docs
12:44:01FromDiscord<haxscramper> also pretty common ones are "user-defined operators are bad", "the world will turn into chaos if we let people write macros"
12:44:21PMunchI mean, at least that is partially true
12:44:24FromDiscord<haxscramper> again, borderline between personal preferences and unbased FUD claims
12:44:30FromDiscord<haxscramper> still most popular discussion points
12:44:43FromDiscord<haxscramper> yes, everything is true to some extent
12:44:47FromDiscord<haxscramper> even case insensetivity
12:45:03PMunchAs I like to say, meta-programming is like a chainsaw. You can do things a whole lot more efficiently, but it's also much easier to take your own leg of by accident
12:45:04FromDiscord<haxscramper> the question - is that what we should be discussing?
12:45:15FromDiscord<haxscramper> or maybe there are some other, more meaningufl topics
12:45:31PMunchOh for sure, I don't disagree that these are silly things to argue about
12:46:29FromDiscord<haxscramper> Yes, of course everything is useful in moderation. But usually argument against macros is black-and-white discussion↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
12:46:51FromDiscord<haxscramper> Those who write macros complain about typed being unspeced
12:46:56FromDiscord<haxscramper> Or something like that
12:48:03FromDiscord<haxscramper> Those who don't argue about macros turning ecosystem into boiling inferno stiched of myriads of randomized dialects
12:49:34mstPMunch: 'heuristic' was meant to imply vague and lossy, yeah
12:49:54mstPMunch: but it's the least worst heuristic for 'is it a transpiler' I've yet encountered (though, uh, that's not a high bar)
12:50:41mstel__maco, the fact that transpiler is unusually semantically unmoored is kinda the point of the discussion
12:51:40PMunchHmm, this JSONY thing looks pretty neat
12:54:57mstPMunch: being able to paste a JSON block into the middle while still not needing all that ceremony yourself has been v. handy
12:55:10mstI also sometimes use it for quick lines-of-JSON-on-the-wire protocols
12:55:24mstbasically "if the first line sent to the server has no leading [, assume JSONY"
12:55:36mstmeans I can generally trivially test stuff using socat
12:57:26PMunchYeah I like the "if you want structure just paste JSON" approach
12:57:40PMunchWhile still making it trivial to write
12:57:57PMunchOne thing I don't quite understand though is how { "of": "things" } was generated in the example
12:58:41PMunchOh, is it because in a {} subhash every other value is a key?
12:58:45mst{ of things } -> { "of": "things" }
12:58:46mstyes
12:58:49PMunchRight
12:59:13mstbasically, the way to think about it is "make as much of the syntax as possible optional"
12:59:16PMunchI thought it might have to do with the newline and indentation
13:00:01mstnope, it's not whitespace sensitive, *not* doing that was kind of what led me to design it, then I convinced ingy that even if he didn't understand why you wouldn't just use YAML instead it would make a good example for his parsing tools ;)
13:00:35*arkurious joined #nim
13:08:08PMunchWell it is kinda whitespace sensitive since it uses newlines
13:10:44*Vladar quit (Remote host closed the connection)
13:15:10PMunchHaha: https://www.fredrikholmqvist.com/pages/why-i-hate-frameworks.html
13:21:51*Vladar joined #nim
13:23:22FromDiscord<Rika> i just read that a few hours ago lmfao
13:24:38FromDiscord<dom96> 1.6 is out 😮
13:32:59*rockcavera joined #nim
13:32:59*rockcavera quit (Changing host)
13:32:59*rockcavera joined #nim
13:36:12nrds<Prestige99> Awesome!
13:41:41nrds<Prestige99> https://nim-lang.org/blog/2021/10/19/version-160-released.html
13:41:44FromDiscord<dom96> and on HN too, awesome
13:41:54PMunchYup, it's everywhere :)
13:41:57FromDiscord<dom96> where is the launch party?
13:42:12PMunchMy place, seven o'clock?
13:43:00supakeeni'll bring the salmon
13:44:00FromDiscord<narimiran> is case and style (in)sensitivity already mentioned on HN or we're still waiting for it?
13:44:28FromDiscord<dom96> ssssshhh you'll jinx it
13:45:02nrds<Prestige99> wow there are a lot of updates
13:45:54PMunchsupakeen, as if we don't have enough salmon in Norway already :P
13:46:00supakeenthat's the joke!
13:48:09supakeen(it wasn't very good)
13:49:19FromDiscord<dom96> so many HN comments, damn
13:52:14FromDiscord<Gumber> @dom96 remember like 5 years ago when Nim would have a release and it was just fighting FUD / criticism all day on HN?
13:52:38FromDiscord<Gumber> now it's like most of the reception to releases is actually positive and mostly curiosity / warm feedback
13:52:43FromDiscord<Gumber> what a refreshing / joyous change
13:53:44supakeenSuspicious amount of GC talk.
13:54:46FromDiscord<Gumber> actually there's not much comparatively
14:00:04FromDiscord<Rika> Where’s the insensitivity comment
14:01:57PMunchSsssshhh
14:02:05FromDiscord<exelotl> where's the tweet I can RT? :P
14:02:39PMunchHmm, maybe this is the right moment to write an article about Futhark. Ride the wave of Nim curiosity
14:03:13FromDiscord<haxscramper> https://news.ycombinator.com/item?id=28918044 there is one for whitespace↵(@Rika)
14:04:03FromDiscord<haxscramper> I mean sure, "since the whitespace is significant, it ends up being one more potential source of bugs."
14:04:29FromDiscord<haxscramper> since `<insert any language feature>` is significant, misusing it can lead to bugs
14:04:38FromDiscord<haxscramper> like mistyping variable names
14:04:42FromDiscord<dom96> In reply to @Gumber "<@!132595483838251008> remember like 5": Honestly hard for me to tell whether there is less FUD these days. There is definitely less "but style insensitivity omg"
14:05:09*PMunch quit (Quit: Leaving)
14:05:09FromDiscord<haxscramper> what was it called? "Shadowing of the variable in for loop scope is a latent bug"
14:05:10FromDiscord<haxscramper> yeah sure, whatever
14:05:11FromDiscord<Gumber> well, at least there seems to be way more positivity
14:05:47FromDiscord<dom96> Anyway, we've come far: https://web.archive.org/web/20110704041631/http://force7.de/nimrod/ 🙂
14:06:05FromDiscord<Rika> In reply to @haxscramper "I mean sure, "since": Since the variable name casing is significant …
14:06:06FromDiscord<Rika> Heh
14:06:46*Gustavo6046 quit (Ping timeout: 252 seconds)
14:06:48FromDiscord<dom96> (and that takes me back to the discussion we've had about Nim and Python, you can clearly see it's mentioned there ;))
14:06:57FromDiscord<Rika> Anyway these kinds of discussions always drain me of energy
14:07:04FromDiscord<Rika> So perhaps I shall stop reading
14:08:16FromDiscord<dom96> I love reading these discussions
14:08:44*Gustavo6046 joined #nim
14:08:44FromDiscord<Rika> In reply to @dom96 "(and that takes me": Well okay, Nim takes a good amount of inspiration from Python, but it still doesn’t mean it should take more
14:09:01FromDiscord<haxscramper> `[x for y in z if q]`
14:09:05FromDiscord<Rika> In reply to @dom96 "I love reading these": I don’t, some debates are just annoying to keep on reading
14:09:06FromDiscord<dom96> In reply to @Rika "Well okay, Nim takes": `snake_case` definitely not, other things perhaps
14:09:18FromDiscord<haxscramper> I mean how come you don't want this
14:09:27FromDiscord<Rika> In reply to @dom96 "`snake_case` definitely not, other": Yes perhaps some, I do not mean whole of Python is not something to take inspiration from
14:09:34mstfor x in "foo", "bar":
14:09:37mstfor x in "foo":
14:09:45*mst beats himself unconscious with his own keyboard
14:10:00FromDiscord<Rika> Poor keyboard
14:10:02FromDiscord<haxscramper> time to slice pythong list
14:10:11FromDiscord<haxscramper> `:::::-1-1-2-1-2-31::`
14:10:18FromDiscord<dom96> I remember the time when Nim had no slicing
14:10:26FromDiscord<dom96> And I wanted to just copy Python
14:10:27FromDiscord<haxscramper> that's how you get x^288th element
14:10:32FromDiscord<dom96> Araq gave great arguments why we shouldn't
14:10:32FromDiscord<Rika> In reply to @dom96 "I love reading these": Some discussions are genuinely nice to read but that’s like diamond in the rough
14:10:36*mst really likes snake_case
14:10:38*rb joined #nim
14:10:40FromDiscord<dom96> and so we didn't, that's how we should do things
14:10:50FromDiscord<Rika> Yeah
14:11:02*mst would suggest people remember that the only reason for camelCase is that xerox PARC's ASCII variant didn't actually have an _ so they had to improvise
14:11:13FromDiscord<Rika> Discussion is always good until it devolves into shouting
14:11:20mstI do have an _ so damnit I'm going to use it
14:11:35mst(the way nim lets people not have to care about that is both insane and really quite neat in that regard ;)
14:11:36FromDiscord<Rika> I mean you do you that’s the point of style insensitivity
14:11:47FromDiscord<Rika> Insane as in
14:11:51FromDiscord<Rika> What way
14:12:09NimEventerNew thread by Solo989: VarArgs Broke on latest nim., see https://forum.nim-lang.org/t/8513
14:12:21FromDiscord<dom96> yep, and you could do so much more: make the doc generator display the symbols in your favourite style, make your IDE completely style insensitive, make Nim understand which style you're using and show appropriate error messages
14:12:37mstI'm sorry, I'm not going to get into an argument over whether the word 'insane' is a compliment or not
14:12:50mstgo argue with somebody over what a transpiler is instead :P
14:13:26FromDiscord<Rika> Aww
14:14:40*mst still suspects that in theory he would have preferred foo_bar -> fooBar rather than just ignoring case and underscores entirely, but in practice I've yet to run into a case where that actually made a difference so *meh*
14:16:55FromDiscord<Rika> Differing ways of capitalising acronyms. Nim prefers not shouting (Html), some do as written in English (HTML)
14:17:04FromDiscord<dom96> it sucks that the IRC<->Discord bridge doesn't support actions
14:49:01FromDiscord<narimiran> "I started looking at Nim a few months ago, but I didn't like the feature where it ignores underscores and capitalization."
14:49:03FromDiscord<haxscramper> https://news.ycombinator.com/item?id=28918562
14:49:09FromDiscord<haxscramper> now we are talking
14:49:10FromDiscord<narimiran> ding-ding-ding, we have a winner
14:49:28FromDiscord<narimiran> (did we post the same thing at the same time? :))
14:49:33FromDiscord<haxscramper> almost
14:49:44FromDiscord<haxscramper> well, modulo matrix bridge lag of course
14:50:35FromDiscord<narimiran> ok, if somebody decides to reply — there is `nimgrep` which deals with "make grepping harder"
14:52:31FromDiscord<haxscramper> I don't use nimgrep evenm
14:52:55FromDiscord<haxscramper> `rg` is still faster, and I used it for everything else
14:53:07FromDiscord<haxscramper> and I never had any issues with style insensetivity
14:53:18FromDiscord<enthus1ast> i find the "whitespace" vs braces quite amusing actually \:)↵one should have whitespace any how, but when a brace is not in place, you dont see it, and must count...
14:53:35FromDiscord<enthus1ast> every time i edit js ....
14:53:51FromDiscord<narimiran> rainbow parentheses plugin 😉
14:54:05FromDiscord<enthus1ast> have it↵(@narimiran)
14:54:25mstI prefer braces -and- sensible indentation over just indentation
14:54:31FromDiscord<enthus1ast> fixing identation bugs takes seconds
14:54:38mstbut I don't care about that enough to mind nim's syntax
14:54:50FromDiscord<haxscramper> I updated reply↵(@narimiran)
14:55:34FromDiscord<Rika> In reply to @narimiran "ding-ding-ding, we have a": HES REASONABLE THO
14:55:43FromDiscord<Rika> hes not like "fuck this this is scuffed" or w/e
14:56:38FromDiscord<haxscramper> THO
14:56:51FromDiscord<Rika> In reply to @narimiran "rainbow parentheses plugin 😉": then that is one more argument against "default tooling doesnt work well with whitespace", nice
14:57:29FromDiscord<Rika> enthusiast: many indentation bugs give errors as cryptic as C++ template errors sometimes
14:59:26msthttps://news.ycombinator.com/item?id=28918780
14:59:48mst(I think that reads as friendly, it's supposed to at least)
14:59:56FromDiscord<dom96> In reply to @Rika "hes not like "fuck": true
15:00:59FromDiscord<haxscramper> hn discussion I linked had approximately \~2855 words worth of text
15:01:06FromDiscord<haxscramper> 2.5k+ words for this crp
15:01:08FromDiscord<Rika> mst lmfao
15:01:20FromDiscord<Rika> its more passive aggressive id say
15:05:47mstRika, I went with 'not had time' to try and defang that but yeah probably
15:05:50*mst shrugs
15:17:42FromDiscord<dom96> Hrm, I think it reads friendly
15:18:18mstprobably depends on the reader, but I'm just going to leave it up and led what happens happen
15:18:27mstif I get docked an imaginary internet point or three that's fine
15:18:36mstusually that happens when people don't understand a pun
15:21:12FromDiscord<IsaacPaul> I did not know nim was style insensitive.. honestly, I'm still getting used to the white space and I dont see an issue with the capitalization stuff
15:21:24FromDiscord<IsaacPaul> (edit) "capitalization" => "style"
15:22:18FromDiscord<Rika> ~~well its something you dont notice unless you're looking for a fight~~
15:22:25FromDiscord<el__maco> the only "problem" I have had with the syntax so far is the occasional requirement to add blanks where I would normally have none. Seems a bit odd that ``a=-1 `` type of statement doesn't seem to work
15:22:42FromDiscord<Rika> because it parses as a =- 1
15:22:49FromDiscord<el__maco> similar thing with the star sometimes
15:22:59FromDiscord<Rika> example?
15:23:46FromDiscord<enthus1ast> i would argue that you normally should have a whitespace there
15:24:06*Gustavo6046 quit (Read error: Connection reset by peer)
15:24:40FromDiscord<el__maco> doesn't something like ``var a=10`` require a blank
15:24:43mstenthus1ast you would. I would. I've seen a fair bit of code that didn't, especially when doing multiple assignments
15:24:54mst(a=-1,b=7) type of code
15:25:28FromDiscord<el__maco> what is this =- operator anyways
15:26:18nrds<Prestige99> a = -1 ?
15:27:16*Gustavo6046 joined #nim
15:27:22FromDiscord<IsaacPaul> Swift enforces spacing. I like it a lot. Gives me 1 less thing to to think about lol
15:27:55nrds<Prestige99> wonder if nimpretty handles that case
15:29:07FromDiscord<Rika> In reply to @el__maco "what is this =-": possible operator
15:29:28FromDiscord<Rika> In reply to @el__maco "doesn't something like ``var": no, `var a = 10` makes no sense
15:29:52FromDiscord<Rika> and `a=10` is not ambiguous i believe
15:30:03FromDiscord<Rika> !eval var a = 10
15:30:06NimBotCompile failed: /usercode/in.nim(1, 7) Error: invalid token: (\29)
15:30:06FromDiscord<el__maco> do I need the ``=-`` operator I wonder. Or ``=``... because if not, I could consider solving this "problem" the same way I solved Nim's unfortunate tendency to reject tabs
15:30:27FromDiscord<Rika> !eval var a = 10; a=10; echo a
15:30:28NimBotCompile failed: /usercode/in.nim(1, 14) Error: invalid token: (\29)
15:30:48FromDiscord<Rika> eh? is this just discord fucking with me or what
15:31:20FromDiscord<treeform> In reply to @tandy "<@!107140179025735680> would you have": Sure. I take all of the jsony PRs.
15:31:38FromDiscord<Rika> In reply to @el__maco "do I need the": the idea is that someone might define it then `a=-1` would change meaning if =- undefined meant using `a = -1`
15:31:56FromDiscord<Rika> just space your operators properly...
15:32:15FromDiscord<el__maco> I don't want extra spaces, they are noise to me
15:32:34FromDiscord<el__maco> just aesthetic preference 🤷‍♂️
15:33:16FromDiscord<el__maco> Nim's syntax otherwise is so clean and free from noise
15:33:24FromDiscord<Rika> i mean okay
15:33:30FromDiscord<Rika> cant win every battle i guess
15:33:57FromDiscord<clyybber> @exelotl are you sure https://github.com/nim-lang/Nim/issues/19011 is a regression? AFAICT it an issue on 1.2.x and 1.0.x too
15:34:46*Gustavo6046 quit (Ping timeout: 252 seconds)
15:35:05FromDiscord<exelotl> oh weird
15:35:36FromDiscord<clyybber> (edit) "it" => "it's"
15:37:27FromDiscord<exelotl> @clyybber the following does compile on 1.2.x https://play.nim-lang.org/#ix=3Ce0
15:37:39FromDiscord<exelotl> I assumed it was because the AST didn't have the junk in it
15:37:51FromDiscord<exelotl> but it might just be due to the implementation of parseEnum
15:39:17FromDiscord<clyybber> yeah, still a valid bug of course
15:44:30FromDiscord<exelotl> Amended my ticket:↵> This issue was introduced in Nim 0.19.0. The AST is as-expected in 0.18.x. However, parseEnum could still handle the bad AST until 1.4.0.
15:59:51FromDiscord<juan_carlos> Congrats to all the core team and contributors for 1.6.
16:09:29FromDiscord<retkid> > support for Apple silicon/M1, 32-bit RISC-V, armv8l, CROSSOS, improved support for NodeJS backend
16:09:37FromDiscord<retkid> :O
16:09:42FromDiscord<retkid> big W
16:15:34FromDiscord<iffy (Matt Haggard)> @treeform Does pixie have a built-in way to remove the alpha channel from a PNG file? Browsing the source makes me think no, so I'm just double checking.
16:19:56FromDiscord<Rika> Use nimpng for that instead I would say…
16:32:22FromDiscord<iffy (Matt Haggard)> That was easier than I expected\: http://ix.io/3Ceb
16:32:58FromDiscord<nc-x> is there any roadmap (new features / existing experimental stuff getting stabilized / lots of work on nimsuggest etc) for the next release?
16:33:10FromDiscord<nc-x> (edit) "is there any roadmap (new features / existing experimental stuff getting stabilized / lots of work on nimsuggest etc) ... for" added "planned"
16:33:34FromDiscord<nc-x> (edit) "is there any roadmap (new features / existing experimental stuff getting stabilized / lots of work on nimsuggest ... etc)" added "/ ic / getting rid of forward declarations"
16:33:58FromDiscord<Rika> Issues on GitHub have a milestone system I believe
16:34:03FromDiscord<nc-x> btw congratulations on 1.6 release
16:34:32FromDiscord<nc-x> In reply to @Rika "Issues on GitHub have": nothing for 1.8 yet https://github.com/nim-lang/Nim/milestones
16:34:48FromDiscord<Rika> That is because 1.6 just released
16:34:54FromDiscord<Rika> Over time issues will be added
16:35:14FromDiscord<nc-x> there is one issue in https://github.com/nim-lang/RFCs/milestone/5 but no progress afaik
16:35:43FromDiscord<nc-x> In reply to @Rika "Over time issues will": i know, i am just asking if any "major" things are planned, like making orc default etc..
16:36:10FromDiscord<Rika> I think that is one yes
16:36:21FromDiscord<Rika> Otherwise it’s just scattered in the text channels here
16:37:13FromDiscord<pointystick> Three big things I remember are incremental compilation, CPS and lazy semcheck. I'm not sure what release they're scheduled for, if any
16:38:12FromDiscord<dom96> CPS isn't developed by the core team
16:46:24FromDiscord<leorize> cps already works on 1.6
16:51:27FromDiscord<haxscramper> IC seems to be postponed with no concrete release date, lazy semcheck was barely scratched and unlikely to be released in working capacity any time soon↵(@pointystick)
16:52:08FromDiscord<zetashift> damn, IC sounds like a hard problem to solve!
16:52:25FromDiscord<haxscramper> Milestones can be ignored, nobody bothers to do them anyway↵(@nc-x)
16:53:15FromDiscord<haxscramper> They are not filled/updated/tracked/remembered when aiming for feature and so on
17:07:32*Gustavo6046 joined #nim
17:16:46*Gustavo6046 quit (Ping timeout: 245 seconds)
17:17:20*Gustavo6046 joined #nim
17:54:23FromDiscord<exelotl> if I want to make a macro that outputs a call to a proc (from the same module), how do I ensure it calls the intended proc and not someone else's proc that happens to have the same name?
17:54:44FromDiscord<ynfle (ynfle)> `bindSym`
17:55:25NimEventerNew thread by Shirleyquirk: GenAst, see https://forum.nim-lang.org/t/8514
17:56:07FromDiscord<exelotl> sent a code paste, see https://paste.rs/fA4
17:57:49FromDiscord<ynfle (ynfle)> https://nim-lang.org/docs/manual.html#macros-bindsym Check out this link
18:02:56FromDiscord<haxscramper> Compiler explorer for nim 1.6.0 was merged, should be available soon
18:03:41FromDiscord<haxscramper> Relatively soon, when they roll out new versions\
18:08:33FromDiscord<kevin> Is there a way to stop a `spawn`ed thread?
18:09:19FromDiscord<kevin> sent a code paste, see https://play.nim-lang.org/#ix=3CeG
18:09:26NimEventerNew thread by V3ss0n: The fate of Nim Editors, see https://forum.nim-lang.org/t/8515
18:10:32FromDiscord<exelotl> ynfle: ah thanks!
18:14:41FromDiscord<el__maco> are the config files compatible between 1.4.8 and 1.6.0
18:14:54FromDiscord<el__maco> i.e. can I just copy my nim.cfg over
18:18:03FromDiscord<haxscramper> yes
18:18:10FromDiscord<el__maco> good
18:18:48FromDiscord<haxscramper> there are new recommended flags https://forum.nim-lang.org/t/8511#55108 for this version of course↵(@elmaco)
18:21:57*xet7 quit (Remote host closed the connection)
18:22:57*xet7 joined #nim
18:23:01FromDiscord<el__maco> I notice ``--experimental:codeReordering`` doesn't seem to be the best of ideas to have there
18:28:44FromDiscord<haxscramper> Well, I personally see exactly zero reason for this feature to exist in the first place
18:28:59FromDiscord<haxscramper> Because how hard could it be to write seveal procs forward
18:29:30FromDiscord<haxscramper> Also last time I used this it just hung compiler on mutually recursive generic calls or something like that
18:30:53FromDiscord<el__maco> its the best feature of the language tbh. Writing forward declarations is so silly
18:31:47FromDiscord<haxscramper> I dont' say there is some meaning in that, I say it is so trivial there is no need to maintain another experimental feature for this
18:34:12*xet7 quit (Quit: Leaving)
18:56:28*rockcavera quit (Remote host closed the connection)
19:01:36NimEventerNew thread by Gcao: Does Nim support name for anonymous procedures?, see https://forum.nim-lang.org/t/8516
19:12:31FromDiscord<Koni> is there any command to bootstrap a Nim Project?
19:15:55FromDiscord<zetashift> When one is past the honeymoon phase with a language and straight up into compiler fights!
19:16:18FromDiscord<zetashift> `nimble init`↵(@Koni)
19:17:01FromDiscord<Koni> :hmmok:
19:37:31FromDiscord<exelotl> hmm I just noticed my library has `sgn` and `sgn3` (these names came from the C library I translated) https://media.discordapp.net/attachments/371759389889003532/900105394851045436/unknown.png
19:37:58FromDiscord<exelotl> but Nim already has a `sgn` in std/math which does the same thing as my `sgn3`
19:40:53FromDiscord<exelotl> what would be a better name for a sign function that only ever returns 1 or -1 ?
19:44:24FromDiscord<Elegantbeef> `sign`
19:46:04FromDiscord<ee7> You can also call it signum. "sign" sounds a lot like "sine". See e.g. https://mathworld.wolfram.com/Sign.html
19:47:01FromDiscord<ee7> (Congrats everyone on 1.6!)
19:49:42FromDiscord<exelotl> I'm considering `sign` but it feels backwards. It should be like `del` vs `delete` where the cheaper _"I know what I'm doing"_ version is the one with the abbreviated name
20:09:48*Gustavo6046 quit (Remote host closed the connection)
20:12:15*Gustavo6046 joined #nim
20:12:37FromDiscord<konsumlamm> i see exactly zero reason for `del` and `delete` existing tbh, it only causes confusion
20:20:51FromDiscord<ee7> I meant `sgn3` could be called `signum`, and then you could name the other one something explicit like `signumNoZero` or `signumOnlyOnes`? This isn't compatible with your abbreviated naming thing, though.
20:21:37FromDiscord<ee7> But if you like `sgn3`, you could have `sgn2`.
20:21:39FromDiscord<IsaacPaul> Yea I was just about suggest something like `signFavorPositive`
20:24:51FromDiscord<IsaacPaul> I honestly wouldn't expect sign to ever return 0 tbh. I expect a 'sign' back..
20:26:57FromDiscord<ee7> That's how it works in numpy. See https://numpy.org/doc/stable/reference/generated/numpy.sign.html
20:27:56FromDiscord<IsaacPaul> ooo I got it.. sgn(x: T, zeroResult: T) then just pass in a default value for 0 lol
20:28:13FromDiscord<exelotl> mathematically it makes no sense but in game physics I basically always want a 1 or -1
20:28:34FromDiscord<exelotl> lest I riddle my game with subpixel-perfect collision bugs xD
20:50:59*CyberTailor joined #nim
20:57:59CyberTailorhow to package nim software using distribution's native package manager?
20:58:08CyberTailorportage in particular
21:03:32*rockcavera joined #nim
21:03:32*rockcavera quit (Changing host)
21:03:32*rockcavera joined #nim
21:06:24CyberTailori hope to find some documentation on this topic
21:07:16FromDiscord<Elegantbeef> It's a native binary so it should be similar to C/C++ no?
21:07:37FromDiscord<Elegantbeef> I've never packaged for a package manager so probably blissfully wrong
21:13:37CyberTailorit's similar only in simple compiler invocations
21:17:12FromDiscord<Elegantbeef> Yea i dont know anything so just assumed prebuilt binaries like apt
21:26:21FromDiscord<Slava0135> In reply to @exelotl "mathematically it makes no": in Java math.sign (or something) returns -1/1 as far as i remember
21:27:02*Aherin joined #nim
21:27:14AherinNice!
21:27:50FromDiscord<Slava0135> ok it's called signum
21:28:03FromDiscord<Jan81> Even nicer!
21:28:17FromDiscord<Slava0135> tho it works on Double
21:28:56FromDiscord<Slava0135> why would you need a signum function that returns 0
21:29:27FromDiscord<Slava0135> because you can just compare for 0
21:29:37FromDiscord<Slava0135> if you really need
21:30:57FromDiscord<Slava0135> ~~it's free~~
21:33:13FromDiscord<Elegantbeef> Calculating direction of a vector
21:33:28FromDiscord<konsumlamm> because 0 is neither positive nor negative
21:34:31FromDiscord<Slava0135> true but
21:35:33FromDiscord<Elegantbeef> Exactly to me sign or signum is normalization of a 1D vector
21:35:34FromDiscord<Elegantbeef> `0` is a valid output of "no movement"
21:38:14FromDiscord<Slava0135> in normalization basically you divide each coordinate by length of the vector
21:38:29FromDiscord<Slava0135> 0/0
21:38:41FromDiscord<Slava0135> ~~world crashed~~
21:39:28FromDiscord<Slava0135> 0/0 can be any number
21:39:59FromDiscord<Slava0135> 0/0=x -> 0=0x
21:40:51FromDiscord<Elegantbeef> Well that's one method of normalization
21:41:26FromDiscord<Elegantbeef> Normalization can be thought as getting the direction of a vector
21:41:36FromDiscord<Slava0135> in float there is positive and negative zero
21:42:33FromDiscord<Elegantbeef> so really you're just getting `-` `+` or nothing 😛
21:49:52*Gustavo6046 quit (Ping timeout: 252 seconds)
21:53:22*Gustavo6046 joined #nim
21:59:20*CyberTailor quit (Quit: Konversation terminated!)
22:09:23FromDiscord<exelotl> thoughts on `qsgn` (quick sign) for the version that only returns -1 or 1?
22:11:08*Vladar quit (Quit: Leaving)
22:26:20FromDiscord<impbox [ftsf]> sgn1
22:26:25FromDiscord<impbox [ftsf]> sgn0
22:26:34FromDiscord<impbox [ftsf]> Makes more sense to me
22:27:01FromDiscord<impbox [ftsf]> Postfix is better since you already know you're looking for a sgn function
22:44:30*Gustavo6046 quit (Remote host closed the connection)
22:46:25*Gustavo6046 joined #nim
22:48:20*vicfred joined #nim
22:59:00*supakeen quit (Ping timeout: 258 seconds)
23:08:26*Gustavo6046 quit (Ping timeout: 245 seconds)
23:08:50*Gustavo6046 joined #nim
23:18:45*Gustavo6046_ joined #nim
23:18:58*Gustavo6046 quit (Ping timeout: 252 seconds)
23:21:48*Gustavo6046_ is now known as Gustavo6046
23:36:44*supakeen joined #nim
23:50:40FromDiscord<demotomohiro> sig
23:52:23FromDiscord<demotomohiro> sgn± if you allow to use unicode in identifer
23:55:38FromDiscord<impbox [ftsf]> I find I usually want sgn to return 0 for 0 input when doing gameplay stuff
23:55:56FromDiscord<juan_carlos> `(sic)` operator. 🤣