|
john donne posted:There shouldn't be any operators, only explicit function invocation.
|
# ? Jun 7, 2016 04:17 |
|
|
# ? Jun 8, 2024 03:01 |
|
john donne posted:There shouldn't be any operators, only explicit function invocation. Then we could have equalp, equal, eql, and eq!
|
# ? Jun 7, 2016 04:25 |
|
Since we don't have any operators any more, why not just call it ==? ==(8, D), so elegant and concise.
|
# ? Jun 7, 2016 04:54 |
|
How about explicit message passing? foo.__send__(:==, bar)
|
# ? Jun 7, 2016 05:03 |
|
Drangus McCafferty posted:How about explicit message passing? Isn't that how Objective C works?
|
# ? Jun 7, 2016 05:09 |
|
Absurd Alhazred posted:Isn't that how Objective C works? This is Ruby, but Objective-C is pretty similar (both have roots in smalltalk). [foo someMethod:arg withOtherArg:blah] or to mirror the silly Ruby code (with something you should really never do manually): objc_msgSend(foo, @selector(someMethod:withOtherArg:), arg, blah)
|
# ? Jun 7, 2016 05:24 |
|
Drangus McCafferty posted:How about explicit message passing? That's still not primitive enough, since it also returns something. Use actors or continuations. Don't judge me, I read some of the old lambda papers a week ago.
|
# ? Jun 7, 2016 05:39 |
|
john donne posted:There shouldn't be any operators, only explicit function invocation. An operator is a function with only the tiniest little bit of syntactic sugar.
|
# ? Jun 7, 2016 19:24 |
|
rjmccall posted:No, I think a programmer who had never seen === before (in any language) but was familiar with == (in Ruby and elsewhere) would probably jump to the assumption that === is some kind of variant equality. They might not know what it is, exactly, but they would probably expect it to be symmetric. Using it for case matching is definitely a weird choice when they could easily have gone with something like ~=. Ruby's `===` is hardly any worse than JavaScript's `===`. And while you're right that `==` and `===` are visually similar, one would be remiss to assume that makes them functionally similar. Consider `>=` versus `>>=` in Haskell.
|
# ? Jun 7, 2016 19:26 |
|
xtal posted:Ruby's `===` is hardly any worse than JavaScript's `===`. And while you're right that `==` and `===` are visually similar, one would be remiss to assume that makes them functionally similar. Consider `>=` versus `>>=` in Haskell. These are all terrible design decisions. Terrible.
|
# ? Jun 7, 2016 19:39 |
|
NihilCredo posted:An operator is a function with only the tiniest little bit of syntactic sugar. Syntactic sugar is what causes the code bloat epidemic. We should be writing everything in assembly. xtal posted:Ruby's `===` is hardly any worse than JavaScript's `===`. And while you're right that `==` and `===` are visually similar, one would be remiss to assume that makes them functionally similar. Consider `>=` versus `>>=` in Haskell. Clearly what we need is a <=> operator. And a >=< operator while we're at it.
|
# ? Jun 7, 2016 19:39 |
|
TooMuchAbstraction posted:Syntactic sugar is what causes the code bloat epidemic. We should be writing everything in assembly. What about a >oo < operator?
|
# ? Jun 7, 2016 19:40 |
|
That's the fuzzy comparison, right? The bubbles might pop, they might not. You can't predict!
|
# ? Jun 7, 2016 19:41 |
|
xtal posted:Consider `>=` versus `>>=` in Haskell. These don't look at all alike though The font I'm using which has ligature support for those
|
# ? Jun 7, 2016 19:47 |
|
TooMuchAbstraction posted:Syntactic sugar is what causes the code bloat epidemic. We should be writing everything in assembly. Perl code:
|
# ? Jun 7, 2016 19:56 |
|
I've always liked the idea of <=> being a general comparison operator like the Java Comparable interface. e: Haha! I had no idea Perl actually has this. Does any language have bit rotation operators, like >|>> and <<|< or something? Spatial fucked around with this message at 20:03 on Jun 7, 2016 |
# ? Jun 7, 2016 20:00 |
|
Spatial posted:I've always liked the idea of <=> being a general comparison operator like the Java Comparable interface. Ruby has `<=>` and `Comparable`. Absurd Alhazred posted:These are all terrible design decisions. Terrible. They are pretty terrible because you can't Google them, not because they are visually ambiguous. The Haskell community also has a bad habit of using bare import statements without explicitly marking which functions come from where. You can see a weird operator and have no idea what it does or where it's defined.
|
# ? Jun 7, 2016 20:08 |
|
xtal posted:Ruby's `===` is hardly any worse than JavaScript's `===`. And while you're right that `==` and `===` are visually similar, one would be remiss to assume that makes them functionally similar. Consider `>=` versus `>>=` in Haskell. No, actually, one would be pretty reasonable to assume that an operator that was intentionally chosen because it looks like == was in fact functionally similar to ==, and indeed most languages that have a === (including JavaScript) give it a closely related meaning.
|
# ? Jun 7, 2016 20:23 |
|
rjmccall posted:No, actually, one would be pretty reasonable to assume that an operator that was intentionally chosen because it looks like == was in fact functionally similar to ==, and indeed most languages that have a === (including JavaScript) give it a closely related meaning. I think the biggest problem with the "===" operator in Ruby is that it was never intended to actually be used, but invoked only indirectly in case expressions. They probably would've been better off defining a "when?" method that serves this purpose.
|
# ? Jun 7, 2016 21:07 |
|
It's asymmetric by design. There are a bunch of standard types that intentionally define it asymmetrically. I agree that a better design would just make it a named method.
|
# ? Jun 7, 2016 21:42 |
|
No Safe Word posted:These don't look at all alike though Oh, thanks for that - I had given Fira Code a try, which has similar ligatures, but unfortunately the font itself looks butt-ugly. Hasklig seems much more pleasant.
|
# ? Jun 7, 2016 21:57 |
|
xtal posted:Ruby's `===` is hardly any worse than JavaScript's `===`. And while you're right that `==` and `===` are visually similar, one would be remiss to assume that makes them functionally similar. Consider `>=` versus `>>=` in Haskell. Brb creating a language with the '8=>' operator
|
# ? Jun 7, 2016 23:30 |
|
I don't know how much people like these, but I found code I wrote when I was....11 I think? Possibly 12 or 13, but either way have fun with this pile of nonsense. http://pastebin.com/bATeDASe
|
# ? Jun 7, 2016 23:40 |
|
quiggy posted:Brb creating a language with the '8=>' operator Change the angular interpolation symbology
|
# ? Jun 8, 2016 02:10 |
|
Skyl3lazer posted:I don't know how much people like these, but I found code I wrote when I was....11 I think? Possibly 12 or 13, but either way have fun with this pile of nonsense. This is my favorite bit. code:
|
# ? Jun 8, 2016 14:22 |
|
HardDisk posted:This is my favorite bit. Yeah he really should've rolled that into a loop
|
# ? Jun 8, 2016 15:31 |
|
HardDisk posted:This is my favorite bit. Well I mean how else will they know it's doing something??
|
# ? Jun 8, 2016 16:23 |
|
HardDisk posted:This is my favorite bit.
|
# ? Jun 8, 2016 17:09 |
|
Wait, why can I attack White if I'm White too? Also, I lost my ships between turns? 11-year old Skyl3lazer, please fix your poo poo. Space Kablooey fucked around with this message at 20:42 on Jun 8, 2016 |
# ? Jun 8, 2016 20:37 |
|
HardDisk posted:Wait, why can I attack White if I'm White too? Oh god did you actually run it? So, from what I remember and what I can parse, you lose your ships (all of them, lmao) if you can't pay the total upkeep. Also I think the color of your planet was supposed to be different than the White bad guys, perhaps Gray? Check the fantastic map generation code for that one. Or maybe you're crushing a rebellion, whatever works for you man.
|
# ? Jun 8, 2016 20:48 |
|
I think it was the upkeep then. I spent all my gold on the first turn building ships and production units.
|
# ? Jun 8, 2016 20:54 |
|
On the one hand, what a kludge. On the other hand, still more developed than Star Citizen.
|
# ? Jun 8, 2016 20:55 |
|
TooMuchAbstraction posted:Syntactic sugar is what causes the code bloat epidemic. We should be writing everything in assembly. We shouldn't have any explicit functions, only bit shift operations on unsigned integer literals.
|
# ? Jun 9, 2016 01:36 |
|
john donne posted:We shouldn't have any explicit functions, only bit shift operations on unsigned integer literals. Every language is just syntactic sugar for subleq.
|
# ? Jun 9, 2016 03:12 |
|
quiggy posted:Every language is just syntactic sugar for subleq. Every command is a distraction from the genetic algorithm's evolutionary path.
|
# ? Jun 9, 2016 03:55 |
|
Spatial posted:I've always liked the idea of <=> being a general comparison operator like the Java Comparable interface.
|
# ? Jun 9, 2016 07:30 |
|
root beer posted:PHP has this and calls it a spaceship That's Perl. It also has "yada yada" operator: ... - http://www.activestate.com/blog/2010/04/whats-new-activeperl-rollout-features-perl-512 edit: oh, apparently PHP has it now as well
|
# ? Jun 9, 2016 08:37 |
|
canis minor posted:edit: oh, apparently PHP has it now as well
|
# ? Jun 9, 2016 17:34 |
|
quiggy posted:Every language is just syntactic sugar for subleq. mov is Turing complete (PDF) quote:Thus, while it has been known for quite some time that x86 has far too many instructions, we can now contribute the novel result that it also has far too many registers.
|
# ? Jun 9, 2016 19:24 |
|
|
# ? Jun 8, 2024 03:01 |
|
Yeah, but x86 is a bloated CISC architecture with a zillion addressing modes, while an OISC computer with just subleq can do the job with a lot less transistors.
|
# ? Jun 9, 2016 19:46 |