Moonside
Moonside OP wrote
Reply to comment by devtesla in Internet culture in 2018 by Moonside
Moonside wrote
This is a pretty cute result, we'll see how it goes.
Moonside OP wrote
Reply to comment by deleted in Let's have a Controversial Opinions thread (yes, for real) by Moonside
I was thinking "how come take so spicy landedin my mailbox" but then, oh it was this thread. What's so self-defeating about it, btw?
Moonside wrote (edited )
Reply to comment by twovests in Floating point considered harmful (for games) (a rant by 1vs) by twovests
I actually first stumbled into rational number data type when I was 12 or 13 and learning Lisp (but that story didn't end well and which totally gave me a misleading view of how principled programming languages were). I think all the major functional languages have them as it's not hard to implement as an abstract data type. A super basic is just a product type of two integers and call one the numerator and the other denominator and implement the operations accordingly.
Even Coq has them and if Coq has something implemented, it's probably pretty widespread in Haskell, Standard ML, OCaml, Scala and various Lisps and what have you.
If you really want some numeric nonsense:
- Bad implementations of complex numbers. The rectangular form
a + bi
is good for sums andre^(iθ)
for multiplications. Ideally there should be one type for complex numbers and two classes likedata Complex = Rectangular a b | Polar r θ
in Haskell. This works ok if there are sum types, but apparently this is too avant garde for most languages. - The Haskell numeric tower makes zero sense and is implemented with type classes, which isn't first class and is antimodular to the extent I recommend beginners only use library defined ones and not make your own like at all for a while at least. Like the Num class for numbers: you need to implement the operations
(+)
,(*)
,abs
,signum
,fromInteger
,(-)
whereabs
andsignum
are total party poopers as basically what Num is is a mathematical ring with an extra operation. But, for example, complex numbers don't have a notion of absolute value defined for them so this turns sour quickly. I don't know what would make the situation better, however. They'll never fix this, probably.
Also if you want to read a rant about Booleans... this is pretty good. Every time I'm writing a function that takes a boolean parameter, I split it in two functions or somehow avoid testing for equality in the function. Thus pattern matching is bae and matching constructors is heaven sent. The author's piece on why dynamic languages aren't a thing at all is good too.
Phew, I'm glad that I got all that out of my system!
Moonside OP wrote (edited )
Reply to comment by twovests in Limited size integers considered harmful by Moonside
Sad lofi Nintendo music plays their coders just got REKT
Moonside wrote
They represent real limitations for games (not really, but let's pretend)
They do, actually, if they're used for tracking time. If the game runs long enough (very possible in server-based online games), the physics increasingly start to go wonkier as the simulation becomes less and less fine-grained.
They're susceptible to flaws (different hardware might do different fast float maths - bad for speedruns, maybe? but also not a big deal at all)
It makes things more difficult for emulators, also in subtler ways like different kinds of conventions for rounding. I do wonder if these could be accounted for somehow, there are computations for which accuracy, reproducibility, making sense on a semantic level and so on are importanter than the pursuit of SPEED.
Other places we see floating points where fixed points could work just as well:
- Anything dealing with percentages (likely bounded 0 to 1, or 0 to 100.)
I do wonder how well that actually works. While for probabilities it is always the case that for any event X, 0 ≤ P(X) ≤ 1, you can have steps in calculations that go out of these bounds. For example, 0 ≤ P(A∪B) = P(A) + P(B) - P(A∩B) ≤ 1, but if P(A) = P(B) = 1 then we'll have P(A∪B) = 1 + 1 - 1 = 2 - 1 = 1, where of course 2 > 1.
Also my shout out to humble rational numbers: the opportunities for using them are rare, too rare perhaps, but you feel clean like after having a bath when you do get to use them.
Moonside OP wrote
Moonside wrote
Reply to comment by anand in Some nice math posting about recent work in set theory by mm_
heck yes
Moonside wrote
Reply to comment by toasthaste in Taco Bell has fries now by devtesla
Based on everything I know about Taco Bell not having ever the opportunity to eat there, it seems to me that it's mainly just that it's so greasy. Nothing has so far managed to convince me otherwise.
Moonside OP wrote
Reply to comment by musou in My Modest Rant on how Everything About Learning Coding Stuff is Garbage by Moonside
I can't avoid making up a conspiracy theory that QuickCheck library presently exists as an advert for QuviQ AB and this perhaps goes even further for the Erlang version. Good enough to become somewhat well-known and whet your appetite and then when you get serious, you need to bring consults in.
I was only testing simple mathematical properties (semigroup/monoid/group/Abelian group laws and involutivity) where generator specificity doesn't matter that much. The properties are so general that if a fault was discovered, it would taint a function for all inputs, even accidentally correct.
The one upshot of the whole shebang was that I got to reimplement some stuff as groups and I could just feel the power rushing through my veins ad hoc 'negation' functions into invert
ones. Actually now I looked more into the docs and noticed that Haskell also has Abelian groups as a type class and I added them too to my types.
(It would be really nice if there was something that could automatize writing tests for common typeclasses. I have two types that have instances of semigroups, monoids, groups and Abelian groups and doing tests like I did means that testing their properties and a direct consequence of one took 14 tests which is kind of gross when you could write generic code.)
for what little its worth ive had an easier time using stack with haskell instead of cabal, but only because the book i was learning from used it. but googling for solutions to haskell problems has gotten more difficult now that there's two competing toolchains
I tried out Stack because there's some Emacs tooling around that, but the tooling was quite brittle which soured me a bit on that. There seems to be some amount of Stack related drama in the Haskell community and some people I've learned from have a strong distaste for Stack in favor of Cabal. I'm not in a place to know enough to switch and the problem wasn't really Cabal related. Rather it was, in the small, that the solution involved Template Haskell and sequencing IO actions both of which I haven't done before and, in the large, that no-one has bothered to write documentation or a tutorial on the bird's eye view of things. Or what a best practices could be, I'm not Haskell literate to just see what popular packages are doing.
Moonside OP wrote
Reply to comment by toasthaste in Such a beautiful game by Moonside
It's definitely the main downside of all sports metaphors that interest in any given sport is widely variable
Moonside wrote
Reply to comment by mankyfax in the cat and i share our drinking water by mankyfax
The reverse would keep pets well fed though
Moonside wrote
Reply to comment by Alessia in the cat and i share our drinking water by mankyfax
And if you then stumble upon Medusa, kids...
that's how this happened.
Moonside wrote (edited )
Reply to the cake is a lie XD by voxpoplar
this was always such a shit meme, but honestly Ugandan Knuckles has overtaken it in how it annoys me. Also the meme shits on Wakaliwood, which is actually some amazing film making if you're ask my opinion. Want everything be covered in lava? They'll make it happen, even if it doesn't quite work out. Everyone in an Ugandan village knows kungfu? Well yes, though they might lampshade it.
Also all the '& Knuckles' memeing I've done, I regret it so much now, has Heaven abandoned me????
Moonside wrote
Reply to the cat and i share our drinking water by mankyfax
you can die from cat bites so be safe
Moonside wrote
Reply to comment by musou in the real reason i haven't merged the latest postmill master branch into jstpst yet by hollyhoppet
I think that interfaces can be many and that's perhaps not the issue, even if the command line interface is clunky and more tuned to the particularities of Linus brain folds than anything else. Magit in Emacs is pretty great and I like it and there's no shortage of other GUIs for Git. But I feel like the basic model could be more, say, principled or elegant. I find it somewhat ludicrous that this book is 456 pages long.
This isn't just Git either, I really feel that a lot of utility software for coding has tons of usability issues and quite often it's not like the innards are any better.
Moonside wrote
Reply to comment by devtesla in one of the best alt rock albums ever made by Presidential_Afro
the third guy from left is photoshopped to be some giant nerd
Moonside wrote
After I had read this piece, I clicked on the author's name and was sorely disappointed that this was his only piece on Kotaku. Honestly I'll agree with a fellow commenter over at Polygon comment section: the best piece I've ever read on Polygon and basically set all the noodling around I've done in video games in a new perspective.
Moonside wrote
Reply to I'm clicker training my cat, and the first thing I'm training her to do (besides the basic starting "touch this pointer" stuff) is to leave me the h*ck alone when I'm eating crunchy foods by toasthaste
Honestly impressed, didn't know that could be done.
Moonside wrote
Reply to comment by musou in the real reason i haven't merged the latest postmill master branch into jstpst yet by hollyhoppet
Git is still kinda gross
I'm eagerly waiting for a beautiful future system
Moonside wrote
Reply to Someone vandalized wikipedia, adding their friend into a list of mythological Japanese monsters, then a board game about feudal Japan included it as a kickstarter stretch goal by mm_
The upside is that the design looks pretty kickass.
Moonside wrote
Reply to bad news other #woke tech lovers by Presidential_Afro
There's like a pretty long history of technological servants being feminine in one respect or another have these people never seen old scifi? It's hasn't ever been terribly #woke.
Moonside OP wrote
Reply to comment by musou in Post your dream avatar by Moonside
that's pretty cool if I had been more into anime it def could have been my avatar
Moonside OP wrote
Reply to comment by devtesla in All Followers Are Fake Followers by Moonside
Actually I went and got a custom CSS Chrome extension and got rid of almost all number silliness with these settings on my desktop computer:
Needless to say, this rules. Twitter just feels like relaxed spa now.