Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

john donne posted:

There shouldn't be any operators, only explicit function invocation.
Function invocation should be the () operator.

Adbot
ADBOT LOVES YOU

OddObserver
Apr 3, 2009

john donne posted:

There shouldn't be any operators, only explicit function invocation.

Then we could have equalp, equal, eql, and eq!

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Since we don't have any operators any more, why not just call it ==?

==(8, D), so elegant and concise.

Drangus McCafferty
Jul 29, 2014
How about explicit message passing?

foo.__send__(:==, bar)

Absurd Alhazred
Mar 27, 2010

by Athanatos

Drangus McCafferty posted:

How about explicit message passing?

foo.__send__(:==, bar)

Isn't that how Objective C works?

Drangus McCafferty
Jul 29, 2014

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)

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

Drangus McCafferty posted:

How about explicit message passing?

foo.__send__(:==, bar)

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.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

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.

xtal
Jan 9, 2011

by Fluffdaddy

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.

Absurd Alhazred
Mar 27, 2010

by Athanatos

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.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

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.

Absurd Alhazred
Mar 27, 2010

by Athanatos

TooMuchAbstraction posted:

Syntactic sugar is what causes the code bloat epidemic. We should be writing everything in assembly.


Clearly what we need is a <=> operator. And a >=< operator while we're at it.

What about a >oo < operator?

xzzy
Mar 5, 2009

That's the fuzzy comparison, right? The bubbles might pop, they might not. You can't predict!

No Safe Word
Feb 26, 2005

xtal posted:

Consider `>=` versus `>>=` in Haskell.

These don't look at all alike though :confused:



:smugdog:

The font I'm using which has ligature support for those

qntm
Jun 17, 2009

TooMuchAbstraction posted:

Syntactic sugar is what causes the code bloat epidemic. We should be writing everything in assembly.


Clearly what we need is a <=> operator. And a >=< operator while we're at it.

Perl code:
use strict;
use warnings;

print 4 <=> 5; # -1
print 1 <=> 1; # 0
print 2 <=> 0; # 1

print join " ", sort { $a <=> $b } (1, 34, 56, 0.11, 13, 5);
# 0.11 1 5 13 34 56

Spatial
Nov 15, 2007

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

xtal
Jan 9, 2011

by Fluffdaddy

Spatial posted:

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?

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.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

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.

ExcessBLarg!
Sep 1, 2001

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.
So "case equality" is usually the same as regular equality, and is the same unless it's overridden. If your complaint is that it's asymmetric, "==" has a similar problem since the operator itself is a method defined on the left-hand type, which doesn't have to be commutative (although this is definitely a horror if not).

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.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
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.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt


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.

quiggy
Aug 7, 2010

[in Russian] Oof.


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

Skyl3lazer
Aug 27, 2007

[Dooting Stealthily]



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

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings

quiggy posted:

Brb creating a language with the '8=>' operator

Change the angular interpolation symbology :v:

Space Kablooey
May 6, 2009


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.

http://pastebin.com/bATeDASe

This is my favorite bit.

code:
sub newgame{
$NEWFILE='>'.'saves/'.$province_f.'.sav';
open(NEWFILE) or die("Couldn't Create User!");
print "Founding Province $province DO NOT EXIT";
sleep 1;
print ".";
sleep 1;
print ".";
sleep 1;
print ".";
print "DONE!!\a\n";
print(NEWFILE "1\n0\n0\n0\n2\n100000\n1000\n100\n100\n10000\n0\n0\n0\n0\n$gametype\n$endgame\n$level\n");
close(NEWFILE);
}

quiggy
Aug 7, 2010

[in Russian] Oof.


HardDisk posted:

This is my favorite bit.

code:
sub newgame{
$NEWFILE='>'.'saves/'.$province_f.'.sav';
open(NEWFILE) or die("Couldn't Create User!");
print "Founding Province $province DO NOT EXIT";
sleep 1;
print ".";
sleep 1;
print ".";
sleep 1;
print ".";
print "DONE!!\a\n";
print(NEWFILE "1\n0\n0\n0\n2\n100000\n1000\n100\n100\n10000\n0\n0\n0\n0\n$gametype\n$endgame\n$level\n");
close(NEWFILE);
}

Yeah he really should've rolled that into a loop :rolleye:

Skyl3lazer
Aug 27, 2007

[Dooting Stealthily]



HardDisk posted:

This is my favorite bit.

code:
sub newgame{
$NEWFILE='>'.'saves/'.$province_f.'.sav';
open(NEWFILE) or die("Couldn't Create User!");
print "Founding Province $province DO NOT EXIT";
sleep 1;
print ".";
sleep 1;
print ".";
sleep 1;
print ".";
print "DONE!!\a\n";
print(NEWFILE "1\n0\n0\n0\n2\n100000\n1000\n100\n100\n10000\n0\n0\n0\n0\n$gametype\n$endgame\n$level\n");
close(NEWFILE);
}

Well I mean how else will they know it's doing something??

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

HardDisk posted:

This is my favorite bit.

code:
sub newgame{
$NEWFILE='>'.'saves/'.$province_f.'.sav';
open(NEWFILE) or die("Couldn't Create User!");
print "Founding Province $province DO NOT EXIT";
sleep 1;
print ".";
sleep 1;
print ".";
sleep 1;
print ".";
print "DONE!!\a\n";
print(NEWFILE "1\n0\n0\n0\n2\n100000\n1000\n100\n100\n10000\n0\n0\n0\n0\n$gametype\n$endgame\n$level\n");
close(NEWFILE);
}

:3:

Space Kablooey
May 6, 2009


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. :colbert:

Space Kablooey fucked around with this message at 20:42 on Jun 8, 2016

Skyl3lazer
Aug 27, 2007

[Dooting Stealthily]



HardDisk posted:

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. :colbert:

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.

Space Kablooey
May 6, 2009


I think it was the upkeep then. I spent all my gold on the first turn building ships and production units. :v:

Absurd Alhazred
Mar 27, 2010

by Athanatos
On the one hand, what a kludge. On the other hand, still more developed than Star Citizen.

john donne
Apr 10, 2016

All suitors of all sorts themselves enthral;

So on his back lies this whale wantoning,

And in his gulf-like throat, sucks everything

That passeth near.

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.

quiggy
Aug 7, 2010

[in Russian] Oof.


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.

Absurd Alhazred
Mar 27, 2010

by Athanatos

quiggy posted:

Every language is just syntactic sugar for subleq.

Every command is a distraction from the genetic algorithm's evolutionary path.

DICTATOR OF FUNK
Nov 6, 2007

aaaaaw yeeeeeah

Spatial posted:

I've always liked the idea of <=> being a general comparison operator like the Java Comparable interface.
PHP has this and calls it a spaceship :suicide:

canis minor
May 4, 2011

root beer posted:

PHP has this and calls it a spaceship :suicide:

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

DICTATOR OF FUNK
Nov 6, 2007

aaaaaw yeeeeeah

canis minor posted:

edit: oh, apparently PHP has it now as well
Yeah it's a part of PHP 7 (because the number 6 is for assholes)

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

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.
:science:

Adbot
ADBOT LOVES YOU

Amberskin
Dec 22, 2013

We come in peace! Legit!

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. :colbert:

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply