- Joined
- Feb 8, 2021
Operator overloading is a spook. Operators are a spook. They do not semantically exist and languages syntactically pretend they do exclusively to their own detriment. I will not elaborate.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
t. Deranged LisposexualOperator overloading is a spook. Operators are a spook. They do not semantically exist and languages syntactically pretend they do exclusively to their own detriment. I will not elaborate.
Operator overloading is useful for shit like vector math.Operator overloading is a spook. Operators are a spook. They do not semantically exist and languages syntactically pretend they do exclusively to their own detriment. I will not elaborate.
While him shitting on claude is admirable the way that he does it reveals him to be be absolute faggot - like every single cancuckhttps://youtube.com/watch?v=0mBQlvS8AJQ Rob Pike really fucking hates AI
Having native Vector/Quaternion/Matrix math is much more useful. One of a handful of killer features of Odin.Operator overloading is useful for shit like vector math.
Here's what OCaml does instead of having full operator overloading:Operator overloading is useful for shit like vector math.
Operator overloading is a spook. Operators are a spook. They do not semantically exist and languages syntactically pretend they do exclusively to their own detriment. I will not elaborate.
I like how f# does it. You can just define your own functions that work like infix operators. for exampleOperator overloading is useful for shit like vector math.
open System
let (<|>) a b = //a function to get the distance between two points
Math.Sqrt (((fst a - fst b) ** 2.0) + (snd a - snd b) ** 2.0)
let res =
(1.2,3.4) <|> (5.6,7.8)
let notFoundHandler =
pipeline {
set_status_code 404
plug htmlView (ErrorPageFunction 404)
}
let someMiddleware next ctx =
//do some logging
let r =
router { //this matches routes with "/forwardstuff" already cut out
get "/" (htmlView (Index ctx)) // "/forwardstuff/"
get "/qwert" (htmlView (Index ctx)) // "/forwardstuff/qwert"
}
//more logging
r next ctx
let webapp =
router {
get "/discord" (redirectTo true discordlink)
forward "/forwardstuff" someMiddleware
get "/abc" (htmlString someHTMLFile)
get "/def" (htmlView SomeServerSideRenderedStuff)
post "/login" (htmlView loginFunction)
get "/account" (htmlView accountPage)
delete "/account" (htmlView deleteAccountFunction)
not_found_handler notFoundHangler
}
So much of programming language design is deciding if you’d rather imitate APL or lay down in the gutters with the rest of the swine.I like how f# does it. You can just define your own functions that work like infix operators. for example
Code:open System let (<|>) a b = //a function to get the distance between two points Math.Sqrt (((fst a - fst b) ** 2.0) + (snd a - snd b) ** 2.0) let res = (1.2,3.4) <|> (5.6,7.8)
Or using computation expressions to define local keywords that can be just about anything, for example, from the saturn framework:
Code:let notFoundHandler = pipeline { set_status_code 404 plug htmlView (ErrorPageFunction 404) } let someMiddleware next ctx = //do some logging let r = router { //this matches routes with "/forwardstuff" already cut out get "/" (htmlView (Index ctx)) // "/forwardstuff/" get "/qwert" (htmlView (Index ctx)) // "/forwardstuff/qwert" } //more logging r next ctx let webapp = router { get "/discord" (redirectTo true discordlink) forward "/forwardstuff" someMiddleware get "/abc" (htmlString someHTMLFile) get "/def" (htmlView SomeServerSideRenderedStuff) post "/login" (htmlView loginFunction) get "/account" (htmlView accountPage) delete "/account" (htmlView deleteAccountFunction) not_found_handler notFoundHangler }
Ew. No thanks. These days, for me, the fewer "operators", the better. I am just fine with straight S-expressions and I'd rather skip the parser overheads involved in supporting prefix, postfix, infix, ternary, etc. operators.So much of programming language design is deciding if you’d rather imitate APL or lay down in the gutters with the rest of the swine.
You will never have a one line implimentation of Conway’s Game of Life. You will forever be inferior. Cope and sneedNaturally, in Prolog, all operators can be redefined. https://www.swi-prolog.org/pldoc/man?section=operators
Ew. No thanks. These days, for me, the fewer "operators", the better. I am just fine with straight S-expressions and I'd rather skip the parser overheads involved in supporting prefix, postfix, infix, ternary, etc. operators.
In Haskell you can just put whatever unicode combination as infix operator.
a ⋅ b = [...]is valid Haskell. So isa <⋅> b = [...]
a 🍆💦 b
the best and worst part of C++
Way too many such cases.the best and worst part of C++ is possibly INSERT_GRIEVANCE_HERE because while you can do amazing things with RELATED_FEATURE its also incredibly easy to hang yourself due to complications from both your own stupidity and how they are implemented between compilers.
true just in the case of templates you will end up fucked trying to use crossplatform or cross compiler.Way too many such cases.
You will never have a one line implimentation of Conway’s Game of Life. You will forever be inferior. Cope and sneed
Raku permits similar daemonic faggotry:In Haskell you can just put whatever unicode combination as infix operator.
a ⋅ b = [...]is valid Haskell. So isa <⋅> b = [...]
>codegolf is how languages are compared
APL is code for acolytes of Bertrand Russell who have never once needed to read the code they're responsible for
'Tis the dream of each programmer,
Before his life is done,
To write three lines of APL,
And make the damn things run.
What’s wrong, chud? Scared of a few greek letters? You will never reach programming Nirvana if you can only think in the latin alphabet>codegolf is how languages are compared
APL is code for acolytes of Bertrand Russell who have never once needed to read the code they're responsible for